fix reset password

This commit is contained in:
tcprod 2026-02-10 22:27:32 +01:00
parent b5d7eca97c
commit 442d3f3e0a

View File

@ -59,11 +59,13 @@ class UserService:
async def is_login_valid(self, user_name_or_mail: str, password_clear_text: str) -> bool:
user = await self.get_user(user_name_or_mail)
user_password_hash = sha256(password_clear_text.encode(encoding="utf-8")).hexdigest()
if not user:
return False
if user.user_fallback_password:
user.user_fallback_password == sha256(password_clear_text.encode(encoding="utf-8")).hexdigest()
return user.user_password == sha256(password_clear_text.encode(encoding="utf-8")).hexdigest()
if user.user_fallback_password and user.user_fallback_password == user_password_hash:
return True
return user.user_password == user_password_hash
def _check_for_disallowed_char(self, name: str) -> Optional[str]: