Skip to content

Commit 53c379f

Browse files
fix(auth): require active user for admin routes
get_current_admin_user now depends on get_current_active_user so disabled accounts cannot access admin endpoints. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent f171746 commit 53c379f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/middleware/auth_guard.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ async def get_current_active_user(
4949

5050

5151
async def get_current_admin_user(
52-
current_user: Annotated[User, Depends(get_current_user)],
52+
current_user: Annotated[User, Depends(get_current_active_user)],
5353
) -> User:
54-
"""Require that the current user is an admin."""
54+
"""Require that the current user is an active admin."""
5555
if current_user.is_admin is False:
5656
raise HTTPException(status_code=400, detail="User is not admin")
5757
return current_user

0 commit comments

Comments
 (0)