This commit is contained in:
2026-01-25 16:20:59 +01:00
parent 71f8d4cd51
commit 76834b0e10
2 changed files with 13 additions and 0 deletions

View File

@@ -53,6 +53,11 @@ async def get_current_user(token: str = Depends(oauth2_scheme), db: Session = De
user = db.query(models.User).filter(models.User.username == token_data.username).first()
if user is None:
print(f"DEBUG AUTH: User {token_data.username} not found in DB")
# Dump all users to see what happened
all_users = db.query(models.User).all()
print("DEBUG AUTH: Current users in DB:")
for u in all_users:
print(f" - ID: {u.id}, Username: '{u.username}', Email: '{u.email}'")
raise credentials_exception
print(f"DEBUG AUTH: User found: {user.username}, Is Admin: {user.is_admin}")