Compare commits
2 Commits
b5d7eca97c
...
21cce3d38e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21cce3d38e | ||
|
|
442d3f3e0a |
@ -59,11 +59,12 @@ class UserService:
|
|||||||
|
|
||||||
async def is_login_valid(self, user_name_or_mail: str, password_clear_text: str) -> bool:
|
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 = await self.get_user(user_name_or_mail)
|
||||||
|
user_password_hash = sha256(password_clear_text.encode(encoding="utf-8")).hexdigest()
|
||||||
if not user:
|
if not user:
|
||||||
return False
|
return False
|
||||||
if user.user_fallback_password:
|
if user.user_fallback_password and user.user_fallback_password == user_password_hash:
|
||||||
user.user_fallback_password == sha256(password_clear_text.encode(encoding="utf-8")).hexdigest()
|
return True
|
||||||
return user.user_password == sha256(password_clear_text.encode(encoding="utf-8")).hexdigest()
|
return user.user_password == user_password_hash
|
||||||
|
|
||||||
|
|
||||||
def _check_for_disallowed_char(self, name: str) -> Optional[str]:
|
def _check_for_disallowed_char(self, name: str) -> Optional[str]:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user