This commit is contained in:
11
backend/trading_journal/security.py
Normal file
11
backend/trading_journal/security.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from passlib.context import CryptContext
|
||||
|
||||
pwd_ctx = CryptContext(schemes=["argon2"], deprecated="auto")
|
||||
|
||||
|
||||
def hash_password(plain: str) -> str:
|
||||
return pwd_ctx.hash(plain)
|
||||
|
||||
def verify_password(plain: str, hashed: str) -> bool:
|
||||
return pwd_ctx.verify(plain, hashed)
|
||||
|
||||
Reference in New Issue
Block a user