diff --git a/src/services/open_id.ts b/src/services/open_id.ts index 48d0f8d10..75006da12 100644 --- a/src/services/open_id.ts +++ b/src/services/open_id.ts @@ -22,7 +22,7 @@ function checkOpenIDConfig() { } function isOpenIDEnabled() { - return checkOpenIDConfig().length > 0 ? false : true; + return !(checkOpenIDConfig().length > 0) && options.getOption('mfaMethod') === 'oauth'; } function isUserSaved() { diff --git a/src/services/totp.ts b/src/services/totp.ts index 94ab6c713..66a0c7d60 100644 --- a/src/services/totp.ts +++ b/src/services/totp.ts @@ -3,7 +3,9 @@ import options from './options.js'; import totpEncryptionService from './encryption/totp_encryption.js'; 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 } {