Initial MVP skeleton with auth, chat persistence, UI and text LLM integration
This commit is contained in:
13
backend/app/core/security.py
Normal file
13
backend/app/core/security.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from argon2 import PasswordHasher
|
||||
from argon2.exceptions import VerifyMismatchError
|
||||
|
||||
ph = PasswordHasher()
|
||||
|
||||
def verify_password(plain_password: str, hashed_password: str) -> bool:
|
||||
try:
|
||||
return ph.verify(hashed_password, plain_password)
|
||||
except VerifyMismatchError:
|
||||
return False
|
||||
|
||||
def get_password_hash(password: str) -> str:
|
||||
return ph.hash(password)
|
||||
Reference in New Issue
Block a user