lint
This commit is contained in:
+1
-1
@@ -921,7 +921,7 @@ async function enableTwoFactorAuthentication(user, totpToken, auditSource) {
|
||||
if (user.source === 'ldap' && externalLdap.supports2FA(externalLdapConfig)) throw new BoxError(BoxError.BAD_STATE, 'Cannot enable 2FA of external auth user');
|
||||
|
||||
// Cannot enable TOTP if user has a passkey (user must choose one or the other)
|
||||
const userPasskeys = await passkeys.list(user.id);
|
||||
const userPasskeys = await passkeys.listByUserId(user.id);
|
||||
if (userPasskeys.length > 0) throw new BoxError(BoxError.ALREADY_EXISTS, 'Cannot enable TOTP when passkey is registered');
|
||||
|
||||
const verified = speakeasy.totp.verify({ secret: user.twoFactorAuthenticationSecret, encoding: 'base32', token: totpToken, window: 2 });
|
||||
|
||||
Reference in New Issue
Block a user