Skip to content

Commit

Permalink
[ORG-42] Fix endpoint (#55)
Browse files Browse the repository at this point in the history
* add bcrypt

* update the login and register endpoint

* fix mypy, black and other things

* migrations

* fix endpoint
  • Loading branch information
carlotacb authored Jan 2, 2024
1 parent 6f64192 commit 280840d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion organizator_api/app/users/domain/usecases/login_use_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def execute(self, username: str, password: str) -> uuid.UUID:
if user.token is not None:
return user.token

if bcrypt.checkpw(password.encode("utf-8"), user.password) is False:
check = bcrypt.checkpw(password.encode("utf-8"), bytes(user.password))
if not check:
raise InvalidPassword

user.token = uuid.uuid4()
Expand Down

0 comments on commit 280840d

Please sign in to comment.