Skip to content

Commit ebee4b6

Browse files
fix(dbAuth): Correct hardcoded DB column (#9788)
**Problem** Logging in with webauthn enabled was broken when you had customised your schema to use different column names than the default. See #8743 for details. **Changes** 1. Alters the where clause to use the same column names as the create a few lines below. See: https://github.com/redwoodjs/redwood/blob/c7ae669e36c5e1b7edcd4ee5436558831bad94b8/packages/auth-providers/dbAuth/api/src/DbAuthHandler.ts#L979-L983 **Fixes** Fixes #8743
1 parent 90d83aa commit ebee4b6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -970,8 +970,9 @@ export class DbAuthHandler<
970970

971971
const existingDevice = await this.dbCredentialAccessor.findFirst({
972972
where: {
973-
id: plainCredentialId,
974-
userId: user[this.options.authFields.id],
973+
[this.options.webAuthn.credentialFields.id]: plainCredentialId,
974+
[this.options.webAuthn.credentialFields.userId]:
975+
user[this.options.authFields.id],
975976
},
976977
})
977978

0 commit comments

Comments
 (0)