Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base64Url encode debugging #36

Closed
wants to merge 7 commits into from
Prev Previous commit
Next Next commit
Add a missing replace equals that exists in turnkey’s sdk.
  • Loading branch information
torreyatcitty committed Oct 26, 2023
commit f36f53dbef36109232776e201323f58ba05625b4
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function isBase64url(txt :string) :boolean {

export function toBase64url(buffer :ArrayBuffer) :string {
const txt = btoa(parseBuffer(buffer)) // base64
return txt.replaceAll('+', '-').replaceAll('/', '_')
return txt.replaceAll('+', '-').replaceAll('/', '_').replaceAll('=', '')
}

export function parseBase64url(txt :string) :ArrayBuffer {
Expand Down