Skip to content

Build your personal knowledge base with Trilium Notes

fix: 🐛 fix login error

Jinbde58e5836d8
diff --git a/src/services/open_id.ts b/src/services/open_id.ts
index 48d0f8d105..75006da12c 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 94ab6c713b..66a0c7d60c 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 } {