Repository navigation
Keep the handler's Content-Type on refresh failure, grant example admin by id - #343
Merged
Merged
Conversation
…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.
Coverage Report for CI Build 45572121917Coverage increased (+0.3%) to 88.549%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
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.
When the refresh of an expired cookie token fails,
authcalledJWTService.Resetdirectly.ResetsetsContent-Type: text/plainfor logout responses, so underTracea page whose handler leaves the type to sniffing (http.FileServer, a template page) was served astext/plain. The refresh-failure branch now goes throughresetCookies, as theValidatorand provider rejections already do, in both modules. Only a cookie token reaches the refresh, so the cookies are expired exactly as before.TestTraceRefreshFailureKeepsHandlerContentTypefails 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.VerifConfirmationStoreandNewInMemoryVerifStorenow 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 andAGENTS.mdis indocs/backlog/verify-store-restart-docs.md, to apply once #341 is merged, since #341 rewrites the lines next to both.