From bde58e5836d859f7799098ae87231fa1c43850a6 Mon Sep 17 00:00:00 2001 From: Jin <22962980+JYC333@users.noreply.github.com> Date: Fri, 28 Mar 2025 04:01:18 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20login=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/open_id.ts | 2 +- src/services/totp.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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 } {