From 4474cc42a6bbbf1cbd7e9cccc243dcb6873f7ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Biberle?= Date: Wed, 6 Dec 2023 14:28:36 +0100 Subject: [PATCH] Fix PKCE's URL-safe Base64 encoding --- src/flow/pkce.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/flow/pkce.html b/src/flow/pkce.html index ce9a605..79782a9 100644 --- a/src/flow/pkce.html +++ b/src/flow/pkce.html @@ -128,8 +128,8 @@ const data = encoder.encode(verifier); const digest = await crypto.subtle.digest('SHA-256', data); const base64UrlEncoded = btoa(String.fromCharCode(...new Uint8Array(digest))) - .replace('+', '-') - .replace('/', '_') + .replaceAll('+', '-') + .replaceAll('/', '_') .replace(/=+$/, ''); $('#codeChallenge').val(base64UrlEncoded);