Skip to content

Commit

Permalink
test(pcd/webauthn-pcd): base64 encode challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurgousset committed Dec 11, 2024
1 parent bee43e3 commit 13a07fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/pcd/webauthn-pcd/test/WebAuthnPCD.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ jest.mock("@simplewebauthn/server", () => ({
verifyAuthenticationResponse: async ({
expectedChallenge
}: VerifyAuthenticationResponseOpts): Promise<{ verified: boolean }> => ({
verified: expectedChallenge === "valid_challenge"
verified:
expectedChallenge ===
Buffer.from("valid_challenge").toString("base64").replace(/=+$/, "")
})
}));

Expand Down

0 comments on commit 13a07fc

Please sign in to comment.