Add Sign out button to the sidebar footer#27
Merged
Merged
Conversation
The admin UI had no visible logout — operators had to either hit POST /logout via curl or clear cookies in DevTools. Add a real button to nav.html's sidebar footer (below the Documentation link), in a form that POSTs to /logout. The /logout route already uses requireOperatorSessionExceptCSRF so a stale CSRF token doesn't block the click; the delegated submit handler injects the token anyway since this is a same-origin POST, which is harmless because the handler ignores it. Styled consistently with the existing footer link. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds an in-UI logout affordance to the admin sidebar so operators can reliably end sessions (including “pre-CSRF-plumbing” sessions) without needing curl or manual cookie clearing.
Changes:
- Adds a “Sign out” button to the sidebar footer in
nav.html. - Implements logout as a
POSTform submission to/logout(consistent with the existing route).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The admin UI had no visible logout. Operators wanting to end their session had to either POST to /logout via curl or clear cookies manually in DevTools.
Add a real "Sign out" button to nav.html's sidebar footer (below the Documentation link), in a form that POSTs to /logout.
Why now
This came up because operators with pre-CSRF-plumbing sessions (issued before PR #26 was deployed) had no sieve_csrf cookie, so every form POST failed at the middleware with
csrf token missing or invalid. The fix is logging out + back in, but the UI didn't expose that flow.Notes
requireOperatorSessionExceptCSRFso a stale or missing CSRF token doesn't block the click.Test plan
sieve_sessionandsieve_csrfcookies, redirects to /login.🤖 Generated with Claude Code