Skip to content

Commit

Permalink
fix: encodeBase64URLSafe replaces the base64 instead of the payload
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomontalbano committed Apr 15, 2024
1 parent 1a76499 commit 7dda887
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/js-auth/src/utils/base64.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
*/
export function encodeBase64URLSafe(stringToEncode: string): string {
if (typeof window !== 'undefined') {
return window.btoa(
stringToEncode
return (
window
.btoa(stringToEncode)
// Remove padding equal characters
.replaceAll('=', '')
// Replace characters according to base64url specifications
Expand Down

0 comments on commit 7dda887

Please sign in to comment.