sync mvp-dev to main #2
@ -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:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user