sync mvp-dev to main #2

Merged
Typhus merged 85 commits from mvp-dev into main 2025-01-23 19:25:01 +00:00
Showing only changes of commit c20d437b55 - Show all commits

View File

@ -37,6 +37,13 @@ class UserService:
raise NameNotAllowedError(disallowed_char) raise NameNotAllowedError(disallowed_char)
return self._db_service.update_user(user) return self._db_service.update_user(user)
def is_login_valid(self, user_name_or_mail: str, password_clear_text: str) -> bool:
user = self.get_user(user_name_or_mail)
if not user:
return False
return user.user_password == sha256(password_clear_text.encode(encoding="utf-8")).hexdigest()
def _check_for_disallowed_char(self, name: str) -> Optional[str]: def _check_for_disallowed_char(self, name: str) -> Optional[str]:
for c in name: for c in name:
if c not in self.ALLOWED_USER_NAME_SYMBOLS: if c not in self.ALLOWED_USER_NAME_SYMBOLS: