diff --git a/frontend/app/webauth/[requestCode]/page.tsx b/frontend/app/webauth/[requestCode]/page.tsx index 0c203d86c..643acdef0 100644 --- a/frontend/app/webauth/[requestCode]/page.tsx +++ b/frontend/app/webauth/[requestCode]/page.tsx @@ -148,7 +148,9 @@ export default function WebAuth({ params }: { params: { requestCode: string } }) useEffect(() => { const validateWebAuthRequest = async () => { - const decodedWebAuthReq = await cryptoUtils.decodeb64string(params.requestCode) + const decodedWebAuthReq = await cryptoUtils.decodeb64string( + decodeURIComponent(params.requestCode) + ) const authRequestParams = getWebAuthRequestParams(decodedWebAuthReq) if (!authRequestParams.publicKey || !authRequestParams.requestedTokenName) diff --git a/frontend/utils/auth.ts b/frontend/utils/auth.ts index 54157291b..e55242729 100644 --- a/frontend/utils/auth.ts +++ b/frontend/utils/auth.ts @@ -413,11 +413,11 @@ export namespace cryptoUtils { return `${hostname}/invite/${encodedInvite}` } - export const decodeb64string = async (hash: string) => { + export const decodeb64string = async (b64string: string) => { await _sodium.ready const sodium = _sodium - return sodium.to_string(sodium.from_base64(hash, sodium.base64_variants.ORIGINAL)) + return sodium.to_string(sodium.from_base64(b64string, sodium.base64_variants.ORIGINAL)) } export const getKeyring = async (email: string, organisationId: string, password: string) => {