mirror of
https://github.com/ysoftdevs/oauth-playground-client.git
synced 2026-01-11 22:41:29 +01:00
Fix PKCE's URL-safe Base64 encoding
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user