Skip to content

Commit

Permalink
chore: node: update webauthn dependencies (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarrosop authored Mar 6, 2024
1 parent d8915e5 commit 45315c7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 146 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"dependencies": {
"@djgrant/postgres-migrations": "4.1.0-rc.1",
"@simplewebauthn/server": "^7.4.0",
"@simplewebauthn/server": "^9.0.3",
"axios": "^1.6.7",
"bcryptjs": "^2.4.3",
"body-parser": "1.19.0",
Expand Down Expand Up @@ -80,7 +80,6 @@
"@graphql-codegen/typescript-graphql-request": "^4.5.9",
"@graphql-codegen/typescript-operations": "^2.5.13",
"@simplewebauthn/types": "^9.0.1",
"@simplewebauthn/typescript-types": "^5.4.0",
"@types/bcryptjs": "^2.4.6",
"@types/body-parser": "1.19.0",
"@types/cors": "2.8.6",
Expand Down
159 changes: 19 additions & 140 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/routes/signup/webauthn/signup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { generateRegistrationOptions } from '@simplewebauthn/server';
import { v4 as uuidv4 } from 'uuid';
import { RequestHandler } from 'express';

import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/typescript-types';
import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
import { email, Joi, registrationOptions } from '@/validation';
import { UserRegistrationOptions } from '@/types';

Expand Down Expand Up @@ -52,7 +52,7 @@ export const signUpWebauthnHandler: RequestHandler<
} = options;

const userId = uuidv4();
const registrationOptions = generateRegistrationOptions({
const registrationOptions = await generateRegistrationOptions({
rpID: getWebAuthnRelyingParty(),
rpName: ENV.AUTH_WEBAUTHN_RP_NAME,
userID: userId,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/user/webauthn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const addSecurityKeyHandler: RequestHandler<
id: userId,
});

const options = generateRegistrationOptions({
const options = await generateRegistrationOptions({
rpID: getWebAuthnRelyingParty(),
rpName: ENV.AUTH_WEBAUTHN_RP_NAME,
userID: userId,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/webauthn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const performWebAuthn = async (userId: string) => {
id: userId,
});

const options = generateAuthenticationOptions({
const options = await generateAuthenticationOptions({
rpID: getWebAuthnRelyingParty(),
userVerification: 'preferred',
timeout: ENV.AUTH_WEBAUTHN_ATTESTATION_TIMEOUT,
Expand Down

0 comments on commit 45315c7

Please sign in to comment.