This commit is contained in:
Girish Ramakrishnan
2026-02-17 19:30:33 +01:00
parent 3ef990b0bf
commit 319360f8d0
5 changed files with 68 additions and 101 deletions

View File

@@ -389,7 +389,7 @@ async function interactionLogin(req, res, next) {
// Handle passkey verification if provided
if (!verifyError && user && !user.ghost && passkeyResponse && !totpToken) {
const userPasskeys = await passkeys.list(user.id);
const userPasskeys = await passkeys.listByUserId(user.id);
if (userPasskeys.length > 0) {
const [passkeyError] = await safe(passkeys.verifyAuthentication(user, passkeyResponse));
if (passkeyError) {
@@ -402,14 +402,14 @@ async function interactionLogin(req, res, next) {
// If password verified but 2FA is required and not provided, return challenge
if (!verifyError && user && !user.ghost && !totpToken && !passkeyResponse) {
const userPasskeys = await passkeys.list(user.id);
const userPasskeys = await passkeys.listByUserId(user.id);
const has2FA = user.twoFactorAuthenticationEnabled || userPasskeys.length > 0;
if (has2FA) {
// Generate passkey options if user has passkeys
let passkeyOptions = null;
if (userPasskeys.length > 0) {
const [optionsError, options] = await safe(passkeys.generateAuthenticationOptions(user));
const [optionsError, options] = await safe(passkeys.getAuthenticationOptions(user));
if (!optionsError) passkeyOptions = options;
}