diff --git a/app/api/v1/admin/auth.py b/app/api/v1/admin/auth.py index fb48d185..ad042f33 100644 --- a/app/api/v1/admin/auth.py +++ b/app/api/v1/admin/auth.py @@ -113,6 +113,13 @@ def admin_logout(response: Response): path="/admin", ) - logger.debug("Deleted admin_token cookie") + # Also clear legacy cookie with path=/ (from before path isolation was added) + # This handles users who logged in before the path=/admin change + response.delete_cookie( + key="admin_token", + path="/", + ) + + logger.debug("Deleted admin_token cookies (both /admin and / paths)") return LogoutResponse(message="Logged out successfully")