From 544cdb1031857a382ecd554a4071f43b56ad5570 Mon Sep 17 00:00:00 2001 From: bkellam Date: Fri, 12 Dec 2025 13:45:22 -0800 Subject: [PATCH] fix --- packages/web/src/lib/utils.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/web/src/lib/utils.ts b/packages/web/src/lib/utils.ts index d0030524..6fabd7e4 100644 --- a/packages/web/src/lib/utils.ts +++ b/packages/web/src/lib/utils.ts @@ -62,10 +62,18 @@ export const createPathWithQueryParams = (path: string, ...queryParams: [string, return path; } - const queryString = queryParams.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value ?? '')}`).join('&'); + const queryString = queryParams.map(([key, value]) => `${encodeURIComponent(key)}=${encodeRFC3986URIComponent(value ?? '')}`).join('&'); return `${path}?${queryString}`; } +// @see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent#encoding_for_rfc3986 +const encodeRFC3986URIComponent = (str: string) => { + return encodeURIComponent(str).replace( + /[!'()*]/g, + (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, + ); + } + type AuthProviderInfo = { id: string; name: string;