implemented postgres support in repositories
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
"""Definition of verify_password function."""
|
||||
|
||||
import bcrypt
|
||||
|
||||
|
||||
def verify_password(password: str, hashed_password: str) -> bool:
|
||||
"""Verify a password against a hashed password.
|
||||
|
||||
Args:
|
||||
password: Plain text password to verify
|
||||
hashed_password: Previously hashed password
|
||||
|
||||
Returns:
|
||||
True if password matches, False otherwise
|
||||
"""
|
||||
result: bool = bcrypt.checkpw(
|
||||
password.encode("utf-8"), hashed_password.encode("utf-8")
|
||||
)
|
||||
return result
|
||||
Reference in New Issue
Block a user