Skip to content

Commit

Permalink
fix(pcd/webauthn-pcd): base64 encode expected challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurgousset committed Dec 11, 2024
1 parent 47398f3 commit bee43e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/pcd/webauthn-pcd/src/WebAuthnPCDPackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ export async function prove(args: WebAuthnPCDArgs): Promise<WebAuthnPCD> {
export async function verify(pcd: WebAuthnPCD): Promise<boolean> {
const { verified } = await verifyAuthenticationResponse({
response: pcd.proof,
expectedChallenge: pcd.claim.challenge,
expectedChallenge: Buffer.from(pcd.claim.challenge)
.toString("base64")
.replace(/=+$/, ""),
expectedOrigin: pcd.claim.origin,
expectedRPID: pcd.claim.rpID,
authenticator: {
Expand Down

0 comments on commit bee43e3

Please sign in to comment.