Skip to content

Commit

Permalink
small lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Winston-Hsiao committed Aug 3, 2024
1 parent eb1dfb5 commit 4dd551f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions store/app/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ def create(cls, email: str, password: str) -> Self:
return cls(
id=new_uuid(),
email=email,
hashed_password=hash_password(password),
permissions=None,
created_at=now,
updated_at=now,
hashed_password=hash_password(password) # Call a function to hash the password
)

def update_timestamp(self) -> None:
Expand All @@ -64,7 +64,6 @@ def verify_email(self) -> None:
self.email_verified_at = int(time.time())



class OAuthKey(RobolistBaseModel):
"""Keys for OAuth providers which identify users."""

Expand Down
6 changes: 4 additions & 2 deletions store/app/utils/security.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import bcrypt


def hash_password(password: str) -> str:
salt = bcrypt.gensalt()
return bcrypt.hashpw(password.encode('utf-8'), salt).decode('utf-8')
return bcrypt.hashpw(password.encode("utf-8"), salt).decode("utf-8")


def verify_password(plain_password: str, hashed_password: str) -> bool:
return bcrypt.checkpw(plain_password.encode('utf-8'), hashed_password.encode('utf-8'))
return bcrypt.checkpw(plain_password.encode("utf-8"), hashed_password.encode("utf-8"))

0 comments on commit 4dd551f

Please sign in to comment.