diff --git a/packages/auth-providers/dbAuth/api/src/DbAuthHandler.ts b/packages/auth-providers/dbAuth/api/src/DbAuthHandler.ts index cd441d90e783..54e55cea4e71 100644 --- a/packages/auth-providers/dbAuth/api/src/DbAuthHandler.ts +++ b/packages/auth-providers/dbAuth/api/src/DbAuthHandler.ts @@ -972,8 +972,9 @@ export class DbAuthHandler< const existingDevice = await this.dbCredentialAccessor.findFirst({ where: { - id: plainCredentialId, - userId: user[this.options.authFields.id], + [this.options.webAuthn.credentialFields.id]: plainCredentialId, + [this.options.webAuthn.credentialFields.userId]: + user[this.options.authFields.id], }, })