Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { API_VERSION_HEADER_NAME, BASE64URL_REGEX } from './constants'
import { AuthInvalidJwtError } from './errors'
import { base64UrlToUint8Array, stringFromBase64URL, stringToBase64URL } from './base64url'

Check warning on line 3 in src/lib/helpers.ts

View workflow job for this annotation

GitHub Actions / Test / OS ubuntu-latest / Node 18

'stringToBase64URL' is defined but never used

Check warning on line 3 in src/lib/helpers.ts

View workflow job for this annotation

GitHub Actions / Test / OS ubuntu-latest / Node 20

'stringToBase64URL' is defined but never used
import { JwtHeader, JwtPayload, SupportedStorage } from './types'

export function expiresAt(expiresIn: number) {
Expand Down Expand Up @@ -289,7 +289,7 @@
return verifier
}
const hashed = await sha256(verifier)
return stringToBase64URL(hashed)
return btoa(hashed).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '')
}

export async function getCodeChallengeAndMethod(
Expand Down