From 436b3d8a2ce6a36307ac3755ffef76ae593417bd Mon Sep 17 00:00:00 2001 From: KenTandrian Date: Thu, 6 Mar 2025 22:54:44 +0700 Subject: [PATCH] chore(deps): bump simplewebauthn to v11 --- apps/api/src/app/auth/web-auth.service.ts | 14 +++++++--- .../src/app/services/web-authn.service.ts | 4 +-- package-lock.json | 28 +++++++++---------- package.json | 6 ++-- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/apps/api/src/app/auth/web-auth.service.ts b/apps/api/src/app/auth/web-auth.service.ts index e33bd19ee..cde97e315 100644 --- a/apps/api/src/app/auth/web-auth.service.ts +++ b/apps/api/src/app/auth/web-auth.service.ts @@ -112,7 +112,13 @@ export class WebAuthService { where: { userId: user.id } }); if (registrationInfo && verified) { - const { counter, credentialID, credentialPublicKey } = registrationInfo; + const { + credential: { + counter, + id: credentialID, + publicKey: credentialPublicKey + } + } = registrationInfo; let existingDevice = devices.find( (device) => @@ -188,9 +194,9 @@ export class WebAuthService { let verification: VerifiedAuthenticationResponse; try { const opts: VerifyAuthenticationResponseOpts = { - authenticator: { - credentialID: isoBase64URL.fromBuffer(device.credentialId), - credentialPublicKey: device.credentialPublicKey, + credential: { + id: isoBase64URL.fromBuffer(device.credentialId), + publicKey: device.credentialPublicKey, counter: device.counter }, expectedChallenge: `${user.authChallenge}`, diff --git a/apps/client/src/app/services/web-authn.service.ts b/apps/client/src/app/services/web-authn.service.ts index c5e186362..054f6b40e 100644 --- a/apps/client/src/app/services/web-authn.service.ts +++ b/apps/client/src/app/services/web-authn.service.ts @@ -45,7 +45,7 @@ export class WebAuthnService { return of(null); }), switchMap((attOps) => { - return startRegistration(attOps); + return startRegistration({ optionsJSON: attOps }); }), switchMap((credential) => { return this.http.post( @@ -90,7 +90,7 @@ export class WebAuthnService { ) .pipe( switchMap((requestOptionsJSON) => { - return startAuthentication(requestOptionsJSON); + return startAuthentication({ optionsJSON: requestOptionsJSON }); }), switchMap((credential) => { return this.http.post<{ authToken: string }>( diff --git a/package-lock.json b/package-lock.json index 6b1c60bfa..e718ea744 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,8 +41,8 @@ "@nestjs/schedule": "4.1.2", "@nestjs/serve-static": "4.0.2", "@prisma/client": "6.4.1", - "@simplewebauthn/browser": "10.0.0", - "@simplewebauthn/server": "10.0.1", + "@simplewebauthn/browser": "11.0.0", + "@simplewebauthn/server": "11.0.0", "@stripe/stripe-js": "5.4.0", "alphavantage": "2.2.0", "big.js": "6.2.2", @@ -120,7 +120,7 @@ "@nx/web": "20.3.2", "@nx/workspace": "20.3.2", "@schematics/angular": "19.0.6", - "@simplewebauthn/types": "10.0.0", + "@simplewebauthn/types": "11.0.0", "@storybook/addon-essentials": "8.4.7", "@storybook/addon-interactions": "8.4.7", "@storybook/angular": "8.4.7", @@ -9225,18 +9225,18 @@ } }, "node_modules/@simplewebauthn/browser": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@simplewebauthn/browser/-/browser-10.0.0.tgz", - "integrity": "sha512-hG0JMZD+LiLUbpQcAjS4d+t4gbprE/dLYop/CkE01ugU/9sKXflxV5s0DRjdz3uNMFecatRfb4ZLG3XvF8m5zg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@simplewebauthn/browser/-/browser-11.0.0.tgz", + "integrity": "sha512-KEGCStrl08QC2I561BzxqGiwoknblP6O1YW7jApdXLPtIqZ+vgJYAv8ssLCdm1wD8HGAHd49CJLkUF8X70x/pg==", "license": "MIT", "dependencies": { - "@simplewebauthn/types": "^10.0.0" + "@simplewebauthn/types": "^11.0.0" } }, "node_modules/@simplewebauthn/server": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@simplewebauthn/server/-/server-10.0.1.tgz", - "integrity": "sha512-djNWcRn+H+6zvihBFJSpG3fzb0NQS9c/Mw5dYOtZ9H+oDw8qn9Htqxt4cpqRvSOAfwqP7rOvE9rwqVaoGGc3hg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@simplewebauthn/server/-/server-11.0.0.tgz", + "integrity": "sha512-zu8dxKcPiRUNSN2kmrnNOzNbRI8VaR/rL4ENCHUfC6PEE7SAAdIql9g5GBOd/wOVZolIsaZz3ccFxuGoVP0iaw==", "license": "MIT", "dependencies": { "@hexagon/base64": "^1.1.27", @@ -9246,7 +9246,7 @@ "@peculiar/asn1-rsa": "^2.3.8", "@peculiar/asn1-schema": "^2.3.8", "@peculiar/asn1-x509": "^2.3.8", - "@simplewebauthn/types": "^10.0.0", + "@simplewebauthn/types": "^11.0.0", "cross-fetch": "^4.0.0" }, "engines": { @@ -9263,9 +9263,9 @@ } }, "node_modules/@simplewebauthn/types": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@simplewebauthn/types/-/types-10.0.0.tgz", - "integrity": "sha512-SFXke7xkgPRowY2E+8djKbdEznTVnD5R6GO7GPTthpHrokLvNKw8C3lFZypTxLI7KkCfGPfhtqB3d7OVGGa9jQ==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@simplewebauthn/types/-/types-11.0.0.tgz", + "integrity": "sha512-b2o0wC5u2rWts31dTgBkAtSNKGX0cvL6h8QedNsKmj8O4QoLFQFR3DBVBUlpyVEhYKA+mXGUaXbcOc4JdQ3HzA==", "license": "MIT" }, "node_modules/@sinclair/typebox": { diff --git a/package.json b/package.json index a94bd9374..0a0ac81f9 100644 --- a/package.json +++ b/package.json @@ -87,8 +87,8 @@ "@nestjs/schedule": "4.1.2", "@nestjs/serve-static": "4.0.2", "@prisma/client": "6.4.1", - "@simplewebauthn/browser": "10.0.0", - "@simplewebauthn/server": "10.0.1", + "@simplewebauthn/browser": "11.0.0", + "@simplewebauthn/server": "11.0.0", "@stripe/stripe-js": "5.4.0", "alphavantage": "2.2.0", "big.js": "6.2.2", @@ -166,7 +166,7 @@ "@nx/web": "20.3.2", "@nx/workspace": "20.3.2", "@schematics/angular": "19.0.6", - "@simplewebauthn/types": "10.0.0", + "@simplewebauthn/types": "11.0.0", "@storybook/addon-essentials": "8.4.7", "@storybook/addon-interactions": "8.4.7", "@storybook/angular": "8.4.7",