Skip to content

Commit 91d0f06

Browse files
Josh-Walker-GMjtoar
authored andcommitted
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 d5d125c commit 91d0f06

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
@@ -972,8 +972,9 @@ export class DbAuthHandler<
972972

973973
const existingDevice = await this.dbCredentialAccessor.findFirst({
974974
where: {
975-
id: plainCredentialId,
976-
userId: user[this.options.authFields.id],
975+
[this.options.webAuthn.credentialFields.id]: plainCredentialId,
976+
[this.options.webAuthn.credentialFields.userId]:
977+
user[this.options.authFields.id],
977978
},
978979
})
979980

0 commit comments

Comments
 (0)