fix
This commit is contained in:
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user