Browse Source

chore(deps): bump simplewebauthn to v11

pull/4407/head
KenTandrian 6 months ago
parent
commit
436b3d8a2c
  1. 14
      apps/api/src/app/auth/web-auth.service.ts
  2. 4
      apps/client/src/app/services/web-authn.service.ts
  3. 28
      package-lock.json
  4. 6
      package.json

14
apps/api/src/app/auth/web-auth.service.ts

@ -112,7 +112,13 @@ export class WebAuthService {
where: { userId: user.id } where: { userId: user.id }
}); });
if (registrationInfo && verified) { if (registrationInfo && verified) {
const { counter, credentialID, credentialPublicKey } = registrationInfo; const {
credential: {
counter,
id: credentialID,
publicKey: credentialPublicKey
}
} = registrationInfo;
let existingDevice = devices.find( let existingDevice = devices.find(
(device) => (device) =>
@ -188,9 +194,9 @@ export class WebAuthService {
let verification: VerifiedAuthenticationResponse; let verification: VerifiedAuthenticationResponse;
try { try {
const opts: VerifyAuthenticationResponseOpts = { const opts: VerifyAuthenticationResponseOpts = {
authenticator: { credential: {
credentialID: isoBase64URL.fromBuffer(device.credentialId), id: isoBase64URL.fromBuffer(device.credentialId),
credentialPublicKey: device.credentialPublicKey, publicKey: device.credentialPublicKey,
counter: device.counter counter: device.counter
}, },
expectedChallenge: `${user.authChallenge}`, expectedChallenge: `${user.authChallenge}`,

4
apps/client/src/app/services/web-authn.service.ts

@ -45,7 +45,7 @@ export class WebAuthnService {
return of(null); return of(null);
}), }),
switchMap((attOps) => { switchMap((attOps) => {
return startRegistration(attOps); return startRegistration({ optionsJSON: attOps });
}), }),
switchMap((credential) => { switchMap((credential) => {
return this.http.post<AuthDeviceDto>( return this.http.post<AuthDeviceDto>(
@ -90,7 +90,7 @@ export class WebAuthnService {
) )
.pipe( .pipe(
switchMap((requestOptionsJSON) => { switchMap((requestOptionsJSON) => {
return startAuthentication(requestOptionsJSON); return startAuthentication({ optionsJSON: requestOptionsJSON });
}), }),
switchMap((credential) => { switchMap((credential) => {
return this.http.post<{ authToken: string }>( return this.http.post<{ authToken: string }>(

28
package-lock.json

@ -41,8 +41,8 @@
"@nestjs/schedule": "4.1.2", "@nestjs/schedule": "4.1.2",
"@nestjs/serve-static": "4.0.2", "@nestjs/serve-static": "4.0.2",
"@prisma/client": "6.4.1", "@prisma/client": "6.4.1",
"@simplewebauthn/browser": "10.0.0", "@simplewebauthn/browser": "11.0.0",
"@simplewebauthn/server": "10.0.1", "@simplewebauthn/server": "11.0.0",
"@stripe/stripe-js": "5.4.0", "@stripe/stripe-js": "5.4.0",
"alphavantage": "2.2.0", "alphavantage": "2.2.0",
"big.js": "6.2.2", "big.js": "6.2.2",
@ -120,7 +120,7 @@
"@nx/web": "20.3.2", "@nx/web": "20.3.2",
"@nx/workspace": "20.3.2", "@nx/workspace": "20.3.2",
"@schematics/angular": "19.0.6", "@schematics/angular": "19.0.6",
"@simplewebauthn/types": "10.0.0", "@simplewebauthn/types": "11.0.0",
"@storybook/addon-essentials": "8.4.7", "@storybook/addon-essentials": "8.4.7",
"@storybook/addon-interactions": "8.4.7", "@storybook/addon-interactions": "8.4.7",
"@storybook/angular": "8.4.7", "@storybook/angular": "8.4.7",
@ -9225,18 +9225,18 @@
} }
}, },
"node_modules/@simplewebauthn/browser": { "node_modules/@simplewebauthn/browser": {
"version": "10.0.0", "version": "11.0.0",
"resolved": "https://registry.npmjs.org/@simplewebauthn/browser/-/browser-10.0.0.tgz", "resolved": "https://registry.npmjs.org/@simplewebauthn/browser/-/browser-11.0.0.tgz",
"integrity": "sha512-hG0JMZD+LiLUbpQcAjS4d+t4gbprE/dLYop/CkE01ugU/9sKXflxV5s0DRjdz3uNMFecatRfb4ZLG3XvF8m5zg==", "integrity": "sha512-KEGCStrl08QC2I561BzxqGiwoknblP6O1YW7jApdXLPtIqZ+vgJYAv8ssLCdm1wD8HGAHd49CJLkUF8X70x/pg==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@simplewebauthn/types": "^10.0.0" "@simplewebauthn/types": "^11.0.0"
} }
}, },
"node_modules/@simplewebauthn/server": { "node_modules/@simplewebauthn/server": {
"version": "10.0.1", "version": "11.0.0",
"resolved": "https://registry.npmjs.org/@simplewebauthn/server/-/server-10.0.1.tgz", "resolved": "https://registry.npmjs.org/@simplewebauthn/server/-/server-11.0.0.tgz",
"integrity": "sha512-djNWcRn+H+6zvihBFJSpG3fzb0NQS9c/Mw5dYOtZ9H+oDw8qn9Htqxt4cpqRvSOAfwqP7rOvE9rwqVaoGGc3hg==", "integrity": "sha512-zu8dxKcPiRUNSN2kmrnNOzNbRI8VaR/rL4ENCHUfC6PEE7SAAdIql9g5GBOd/wOVZolIsaZz3ccFxuGoVP0iaw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@hexagon/base64": "^1.1.27", "@hexagon/base64": "^1.1.27",
@ -9246,7 +9246,7 @@
"@peculiar/asn1-rsa": "^2.3.8", "@peculiar/asn1-rsa": "^2.3.8",
"@peculiar/asn1-schema": "^2.3.8", "@peculiar/asn1-schema": "^2.3.8",
"@peculiar/asn1-x509": "^2.3.8", "@peculiar/asn1-x509": "^2.3.8",
"@simplewebauthn/types": "^10.0.0", "@simplewebauthn/types": "^11.0.0",
"cross-fetch": "^4.0.0" "cross-fetch": "^4.0.0"
}, },
"engines": { "engines": {
@ -9263,9 +9263,9 @@
} }
}, },
"node_modules/@simplewebauthn/types": { "node_modules/@simplewebauthn/types": {
"version": "10.0.0", "version": "11.0.0",
"resolved": "https://registry.npmjs.org/@simplewebauthn/types/-/types-10.0.0.tgz", "resolved": "https://registry.npmjs.org/@simplewebauthn/types/-/types-11.0.0.tgz",
"integrity": "sha512-SFXke7xkgPRowY2E+8djKbdEznTVnD5R6GO7GPTthpHrokLvNKw8C3lFZypTxLI7KkCfGPfhtqB3d7OVGGa9jQ==", "integrity": "sha512-b2o0wC5u2rWts31dTgBkAtSNKGX0cvL6h8QedNsKmj8O4QoLFQFR3DBVBUlpyVEhYKA+mXGUaXbcOc4JdQ3HzA==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@sinclair/typebox": { "node_modules/@sinclair/typebox": {

6
package.json

@ -87,8 +87,8 @@
"@nestjs/schedule": "4.1.2", "@nestjs/schedule": "4.1.2",
"@nestjs/serve-static": "4.0.2", "@nestjs/serve-static": "4.0.2",
"@prisma/client": "6.4.1", "@prisma/client": "6.4.1",
"@simplewebauthn/browser": "10.0.0", "@simplewebauthn/browser": "11.0.0",
"@simplewebauthn/server": "10.0.1", "@simplewebauthn/server": "11.0.0",
"@stripe/stripe-js": "5.4.0", "@stripe/stripe-js": "5.4.0",
"alphavantage": "2.2.0", "alphavantage": "2.2.0",
"big.js": "6.2.2", "big.js": "6.2.2",
@ -166,7 +166,7 @@
"@nx/web": "20.3.2", "@nx/web": "20.3.2",
"@nx/workspace": "20.3.2", "@nx/workspace": "20.3.2",
"@schematics/angular": "19.0.6", "@schematics/angular": "19.0.6",
"@simplewebauthn/types": "10.0.0", "@simplewebauthn/types": "11.0.0",
"@storybook/addon-essentials": "8.4.7", "@storybook/addon-essentials": "8.4.7",
"@storybook/addon-interactions": "8.4.7", "@storybook/addon-interactions": "8.4.7",
"@storybook/angular": "8.4.7", "@storybook/angular": "8.4.7",

Loading…
Cancel
Save