fix: 🐛 fix login error

This commit is contained in:
Jin 2025-03-28 04:01:18 +01:00
parent 5987dedff8
commit bde58e5836
2 changed files with 4 additions and 2 deletions

View File

@ -22,7 +22,7 @@ function checkOpenIDConfig() {
} }
function isOpenIDEnabled() { function isOpenIDEnabled() {
return checkOpenIDConfig().length > 0 ? false : true; return !(checkOpenIDConfig().length > 0) && options.getOption('mfaMethod') === 'oauth';
} }
function isUserSaved() { function isUserSaved() {

View File

@ -3,7 +3,9 @@ import options from './options.js';
import totpEncryptionService from './encryption/totp_encryption.js'; import totpEncryptionService from './encryption/totp_encryption.js';
function isTotpEnabled(): boolean { function isTotpEnabled(): boolean {
return options.getOption('mfaEnabled') === "true" && options.getOption('mfaMethod') === "totp"; return options.getOption('mfaEnabled') === "true" &&
options.getOption('mfaMethod') === "totp" &&
totpEncryptionService.isTotpSecretSet();
} }
function createSecret(): { success: boolean; message?: string } { function createSecret(): { success: boolean; message?: string } {