Skip to content

Keep the handler's Content-Type on refresh failure, grant example admin by id - #343

Merged
umputun merged 1 commit into
masterfrom
backlog-review-fixes
Nov 25, 2026
Merged

umputun merged 1 commit into
masterfrom
backlog-review-fixes

Conversation

@umputun

@umputun umputun commented Nov 25, 2026

Copy link
Copy Markdown
Member

When the refresh of an expired cookie token fails, auth called JWTService.Reset directly. Reset sets Content-Type: text/plain for logout responses, so under Trace a page whose handler leaves the type to sniffing (http.FileServer, a template page) was served as text/plain. The refresh-failure branch now goes through resetCookies, as the Validator and provider rejections already do, in both modules. Only a cookie token reaches the refresh, so the cookies are expired exactly as before. TestTraceRefreshFailureKeepsHandlerContentType fails without the change in both modules.

The example granted admin to any user named dev_admin, a name an anonymous or email login can pick. It now checks the id, which only the dev provider leaves without a provider prefix.

The godoc of Opts.VerifConfirmationStore and NewInMemoryVerifStore now says that the in-memory store forgets redeemed tokens on restart, so a confirmation still inside its 30 minutes can be redeemed again. The same note for the README and AGENTS.md is in docs/backlog/verify-store-restart-docs.md, to apply once #341 is merged, since #341 rewrites the lines next to both.

…in by id

A cookie token whose refresh fails went through JWTService.Reset directly, which sets
Content-Type text/plain, so under Trace a page that leaves the type to sniffing was
served as text/plain. The refresh-failure branch now uses resetCookies like the
Validator and provider rejections, in both modules. Only a cookie token reaches the
refresh, so the cookies are expired as before.

The example granted admin to any user named dev_admin, which an anonymous or email
login can pick. It now matches the id, which only the dev provider leaves unprefixed.

The godoc of Opts.VerifConfirmationStore and NewInMemoryVerifStore says a restart
forgets redeemed tokens. The same note for the README and AGENTS.md waits in
docs/backlog until #341 is merged, since it rewrites the lines next to both.
@coveralls

coveralls commented Nov 25, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 45572121917

Coverage increased (+0.3%) to 88.549%

Details

  • Coverage increased (+0.3%) from the base build.
  • Patch coverage: 1 of 1 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4113
Covered Lines: 3642
Line Coverage: 88.55%
Coverage Strength: 15.92 hits per line

💛 - Coveralls

@umputun
umputun merged commit 6c0e178 into master Nov 25, 2026
9 checks passed
@umputun
umputun deleted the backlog-review-fixes branch November 25, 2026 07:59
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.

2 participants