From: Adam Dullage Date: Tue, 6 Feb 2024 19:34:19 +0000 (+0000) Subject: Fixed issue preventing password auth type from being used. X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=104389252c34842b2292f223ff42dc3b4749397e;p=flatnotes.git Fixed issue preventing password auth type from being used. --- diff --git a/server/auth/local/local.py b/server/auth/local/local.py index 6c2eba4..d36932d 100644 --- a/server/auth/local/local.py +++ b/server/auth/local/local.py @@ -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"))