Skip to content

Commit

Permalink
fix(deps): update dependency @simplewebauthn/server to v10 (#5705)
Browse files Browse the repository at this point in the history
* fix(deps): update dependency @simplewebauthn/server to v10

* fix(core): update code to support @simplewebauthn/server v10

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: wangsijie <wangsijie@silverhand.io>
  • Loading branch information
renovate[bot] and wangsijie authored May 13, 2024
1 parent d38ddf1 commit b7d950b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 101 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@logto/shared": "workspace:^3.1.0",
"@silverhand/essentials": "^2.9.0",
"@silverhand/slonik": "31.0.0-beta.2",
"@simplewebauthn/server": "^9.0.0",
"@simplewebauthn/server": "^10.0.0",
"@withtyped/client": "^0.8.7",
"camelcase": "^8.0.0",
"camelcase-keys": "^9.0.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/routes/interaction/utils/webauthn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const generateWebAuthnRegistrationOptions = async ({
const options: GenerateRegistrationOptionsOpts = {
rpName: rpId,
rpID: rpId,
userID: id,
userID: Uint8Array.from(Buffer.from(id)),
userName: getUserDisplayName({ username, primaryEmail, primaryPhone }) ?? 'Unnamed User',
timeout: 60_000,
attestationType: 'none',
Expand All @@ -47,7 +47,7 @@ export const generateWebAuthnRegistrationOptions = async ({
verification.type === MfaFactor.WebAuthn
)
.map(({ credentialId, transports }) => ({
id: Uint8Array.from(Buffer.from(credentialId, 'base64')),
id: credentialId,
type: 'public-key',
transports,
})),
Expand Down Expand Up @@ -99,7 +99,7 @@ export const generateWebAuthnAuthenticationOptions = async ({
const options: GenerateAuthenticationOptionsOpts = {
timeout: 60_000,
allowCredentials: webAuthnVerifications.map(({ credentialId, transports }) => ({
id: isoBase64URL.toBuffer(credentialId),
id: credentialId,
type: 'public-key',
transports,
})),
Expand Down Expand Up @@ -151,7 +151,7 @@ export const verifyWebAuthnAuthentication = async ({
expectedRPID: rpId,
authenticator: {
credentialPublicKey: isoBase64URL.toBuffer(publicKey),
credentialID: isoBase64URL.toBuffer(credentialId),
credentialID: credentialId,
counter,
transports,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const verifyBindWebAuthn = async (

return {
type,
credentialId: isoBase64URL.fromBuffer(credentialID),
credentialId: credentialID,
publicKey: isoBase64URL.fromBuffer(credentialPublicKey),
counter,
agent: userAgent,
Expand Down
111 changes: 16 additions & 95 deletions pnpm-lock.yaml

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

0 comments on commit b7d950b

Please sign in to comment.