feat: init easy backend install from cli

This commit is contained in:
swve 2024-04-19 19:00:49 +02:00
parent 5c7c405e41
commit a6742d17c1
9 changed files with 134 additions and 55 deletions

View file

@ -59,7 +59,7 @@ async def authenticate_user(
user = await security_get_user(request, db_session, email)
if not user:
return False
if not await security_verify_password(password, user.password):
if not security_verify_password(password, user.password):
return False
return user

View file

@ -17,11 +17,11 @@ ALGORITHM = "HS256"
### 🔒 Passwords Hashing ##############################################################
async def security_hash_password(password: str):
def security_hash_password(password: str):
return pbkdf2_sha256.hash(password)
async def security_verify_password(plain_password: str, hashed_password: str):
def security_verify_password(plain_password: str, hashed_password: str):
return pbkdf2_sha256.verify(plain_password, hashed_password)