Skip to content

Fix token form CSRF validation - #121

Merged
bradleymackey merged 1 commit into
mainfrom
codex/track-39-token-csrf
Jul 19, 2026
Merged

Fix token form CSRF validation#121
bradleymackey merged 1 commit into
mainfrom
codex/track-39-token-csrf

Conversation

@bradleymackey

Copy link
Copy Markdown
Collaborator

Summary

  • render the authenticated session CSRF token directly into token create and revoke forms
  • remove the Tokens page's dependency on JavaScript submit-time field injection for native form posts
  • add route-level coverage for native forms, HTMX, missing and invalid CSRF tokens, expired sessions, and one-time raw-token display

Validation

  • DATABASE_URL=postgres://track:track@localhost:5436/track?sslmode=disable go test -count=1 -run 'TestUITokensPageCreatesAndRevokesToken|TestUITokenCreationCSRFVariants' ./internal/server
  • go test -count=1 -run 'TestUISessionCSRFToken|TestUICSRFMiddleware|TestUIClientAssetsSendCSRFTokens' ./internal/server
  • DATABASE_URL=postgres://track:track@localhost:5436/track?sslmode=disable go test -count=1 -coverprofile=/tmp/track39-server-cover.out ./internal/server (67.0%)

@bradleymackey
bradleymackey merged commit 23d31e6 into main Jul 19, 2026
2 checks passed
@bradleymackey
bradleymackey deleted the codex/track-39-token-csrf branch July 19, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant