formatting fixes
Build and Push Docker Image / build-and-push (pull_request) Successful in 58s
Python Code Quality / python-code-quality (pull_request) Successful in 10s
Python Test / python-test (pull_request) Successful in 17s

This commit is contained in:
Brian Bjarke Jensen
2025-11-07 23:56:38 +01:00
parent ef1c7f83b6
commit 19a211121c
3 changed files with 12 additions and 18 deletions
+4 -8
View File
@@ -80,16 +80,12 @@ def login(
# Check if user exists in database
user = user_repo.get_by_username(credentials.username)
if not user:
raise HTTPException(
status_code=401, detail="Invalid username or password"
)
raise HTTPException(status_code=401, detail="Invalid username or password")
# Verify password using bcrypt
if not verify_password(credentials.password, user["hashed_password"]):
raise HTTPException(
status_code=401, detail="Invalid username or password"
)
raise HTTPException(status_code=401, detail="Invalid username or password")
# Generate a secure random token
access_token = secrets.token_urlsafe(32)
token_repo.store(access_token, user_id=user["id"], ttl=3600)