fix: login/logout flow — protected routes + redirect to login on logout
FlowDeck CI / test (push) Failing after 3s
FlowDeck CI / docker (push) Has been skipped

- Logout now redirects to /auth/login?provider=local instead of /
- Dashboard / and /workspace check auth and redirect to login if no session
- _get_user_or_redirect() helper added for reusable auth checks
- No more fallback admin user on dashboard — explicit login required
- Routes without session redirect to login page
This commit is contained in:
2026-07-10 15:57:14 -04:00
parent db8d577c09
commit 7f5ad2aaca
2 changed files with 11 additions and 3 deletions
+2 -2
View File
@@ -272,8 +272,8 @@ async def callback(
@router.get("/logout")
async def logout():
"""Clear session and redirect to dashboard."""
response = RedirectResponse(url="/", status_code=302)
"""Clear session and redirect to login page."""
response = RedirectResponse(url="/auth/login?provider=local", status_code=302)
response.delete_cookie("flowdeck_session")
return response