Skip to content

Commit

Permalink
Merge pull request #500 from MasterKale/fix/477-make-uv-optional-in-e…
Browse files Browse the repository at this point in the history
…xample

fix/477-make-uv-optional-in-example
  • Loading branch information
MasterKale authored Dec 29, 2023
2 parents 5229ceb + 1f1bae6 commit 92d2e70
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions example/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ app.get('/generate-registration-options', async (req, res) => {
})),
authenticatorSelection: {
residentKey: 'discouraged',
/**
* Wondering why user verification isn't required? See here:
*
* https://passkeys.dev/docs/use-cases/bootstrapping/#a-note-about-user-verification
*/
userVerification: 'preferred',
},
/**
* Support the two most common algorithms: ES256, and RS256
Expand Down Expand Up @@ -175,7 +181,7 @@ app.post('/verify-registration', async (req, res) => {
expectedChallenge: `${expectedChallenge}`,
expectedOrigin,
expectedRPID: rpID,
requireUserVerification: true,
requireUserVerification: false,
};
verification = await verifyRegistrationResponse(opts);
} catch (error) {
Expand Down Expand Up @@ -226,7 +232,12 @@ app.get('/generate-authentication-options', async (req, res) => {
type: 'public-key',
transports: dev.transports,
})),
userVerification: 'required',
/**
* Wondering why user verification isn't required? See here:
*
* https://passkeys.dev/docs/use-cases/bootstrapping/#a-note-about-user-verification
*/
userVerification: 'preferred',
rpID,
};

Expand Down Expand Up @@ -272,7 +283,7 @@ app.post('/verify-authentication', async (req, res) => {
expectedOrigin,
expectedRPID: rpID,
authenticator: dbAuthenticator,
requireUserVerification: true,
requireUserVerification: false,
};
verification = await verifyAuthenticationResponse(opts);
} catch (error) {
Expand Down

0 comments on commit 92d2e70

Please sign in to comment.