Skip to content

Commit 504d335

Browse files
authored
chore(deps): Upgrade SimpleWebAuthn to v9 (#67)
1 parent 7044dad commit 504d335

File tree

8 files changed

+122
-204
lines changed

8 files changed

+122
-204
lines changed

.changesets/67.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
- chore(deps): Upgrade SimpleWebAuthn to v9 (#67) by @Tobbe
2+
3+
Update SimpleWebAuthn from v7 to v9 to stop using deprecated package `@simplewebauthn/typescript-types` (it's now `@simplewebauthn/types` instead)
4+
5+
Users will have to upgrade to:
6+
7+
- `@simplewebauthn/[email protected]`
8+
- `@simplewebauthn/[email protected]`
9+
- `@simplewebauthn/[email protected]`
10+
11+
And remove dependency
12+
13+
- `@simplewebauthn/typescript-types`

packages/auth-providers/dbAuth/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"@arethetypeswrong/cli": "0.16.4",
6767
"@redmix/api": "workspace:*",
6868
"@redmix/framework-tools": "workspace:*",
69-
"@simplewebauthn/server": "7.4.0",
69+
"@simplewebauthn/server": "9.0.3",
7070
"@types/md5": "2.3.5",
7171
"@types/uuid": "10.0.0",
7272
"concurrently": "8.2.2",

packages/auth-providers/dbAuth/api/src/DbAuthHandler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type {
1010
import type {
1111
AuthenticationResponseJSON,
1212
RegistrationResponseJSON,
13-
} from '@simplewebauthn/typescript-types'
13+
} from '@simplewebauthn/types'
1414
import type { APIGatewayProxyEvent, Context as LambdaContext } from 'aws-lambda'
1515
import base64url from 'base64url'
1616
import md5 from 'md5'
@@ -948,7 +948,7 @@ export class DbAuthHandler<
948948
rpID: webAuthnOptions.domain,
949949
}
950950

951-
const authOptions = generateAuthenticationOptions(someOptions)
951+
const authOptions = await generateAuthenticationOptions(someOptions)
952952

953953
await this._saveChallenge(
954954
user[this.options.authFields.id],
@@ -994,7 +994,7 @@ export class DbAuthHandler<
994994
)
995995
}
996996

997-
const regOptions = generateRegistrationOptions(options)
997+
const regOptions = await generateRegistrationOptions(options)
998998

999999
await this._saveChallenge(
10001000
user[this.options.authFields.id],

packages/auth-providers/dbAuth/setup/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
"@babel/runtime-corejs3": "7.26.10",
2828
"@prisma/internals": "5.20.0",
2929
"@redmix/cli-helpers": "workspace:*",
30-
"@simplewebauthn/browser": "7.4.0",
30+
"@simplewebauthn/browser": "9.0.1",
3131
"core-js": "3.38.1",
3232
"prompts": "2.4.2",
3333
"terminal-link": "2.1.1"
3434
},
3535
"devDependencies": {
3636
"@babel/cli": "7.26.4",
3737
"@babel/core": "^7.26.10",
38-
"@simplewebauthn/typescript-types": "7.4.0",
38+
"@simplewebauthn/types": "9.0.1",
3939
"@types/yargs": "17.0.33",
4040
"typescript": "5.6.2",
4141
"vitest": "2.1.9"

packages/auth-providers/dbAuth/setup/src/webAuthn.setupData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import { addModels, functionsPath, hasModel, libPath } from './shared'
99
export { extraTask } from './setupData'
1010

1111
// required packages to install on the web side
12-
export const webPackages = ['@simplewebauthn/browser@^7']
12+
export const webPackages = ['@simplewebauthn/browser@^9']
1313

1414
// required packages to install on the api side
15-
export const apiPackages = ['@simplewebauthn/server@^7']
15+
export const apiPackages = ['@simplewebauthn/server@^9']
1616

1717
export const createUserModelTask = {
1818
title: 'Creating model `User`...',

packages/auth-providers/dbAuth/web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
"dependencies": {
2727
"@babel/runtime-corejs3": "7.26.10",
2828
"@redmix/auth": "workspace:*",
29-
"@simplewebauthn/browser": "7.4.0",
29+
"@simplewebauthn/browser": "9.0.1",
3030
"core-js": "3.38.1"
3131
},
3232
"devDependencies": {
3333
"@babel/cli": "7.26.4",
3434
"@babel/core": "^7.26.10",
35-
"@simplewebauthn/typescript-types": "7.4.0",
35+
"@simplewebauthn/types": "9.0.1",
3636
"@types/react": "^18.2.55",
3737
"react": "19.0.0-rc-f2df5694-20240916",
3838
"typescript": "5.6.2",

packages/cli/src/commands/generate/dbAuth/__tests__/dbAuth.mockListr.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const { AuthProvider, useAuth } = createAuth(dbAuthClient)
132132
"private": true,
133133
"dependencies": {
134134
"@redmix/auth-dbauth-web": "7.0.0",
135-
"@simplewebauthn/browser": "7.4.0"
135+
"@simplewebauthn/browser": "9.0.1"
136136
}
137137
}
138138
`

0 commit comments

Comments
 (0)