Fixed issue preventing password auth type from being used.
authorAdam Dullage <redacted>
Tue, 6 Feb 2024 19:34:19 +0000 (19:34 +0000)
committerAdam Dullage <redacted>
Tue, 6 Feb 2024 19:34:19 +0000 (19:34 +0000)
server/auth/local/local.py

index 6c2eba45340effff154657e6431119b5ee4208d2..d36932db4da39573cd97819ddac998a7eda3e944 100644 (file)
@@ -8,7 +8,7 @@ from fastapi.security import OAuth2PasswordBearer
 from jose import JWTError, jwt
 from qrcode import QRCode
 
-from global_config import GlobalConfig
+from global_config import AuthType, GlobalConfig
 from helpers import get_env
 
 from ..base import BaseAuth
@@ -30,7 +30,8 @@ class LocalAuth(BaseAuth):
         )
 
         # TOTP
-        if global_config.auth_type == "totp":
+        self.is_totp_enabled = False
+        if global_config.auth_type == AuthType.TOTP:
             self.is_totp_enabled = True
             self.totp_key = get_env("FLATNOTES_TOTP_KEY", mandatory=True)
             self.totp_key = b32encode(self.totp_key.encode("utf-8"))
git clone https://git.99rst.org/PROJECT