Fixes redirect-based OAuth login when OAUTH_DISABLE_POPUP=true is set - #2171
Merged
Conversation
Contributor
Author
sessionStorage is tab-scoped, so when Authelia (or similar) deliver the OAuth callback in a new browsing context, the stored provider is not found and state verification always fails. Switch to localStorage, which is shared across all tabs/windows of the same origin. Also clean up the stored entry and strip the callback URL on both success and failure paths.
polter-rnd
force-pushed
the
2170-fix-oauth-without-popup
branch
from
July 31, 2026 09:40
701eb1b to
2cde1ae
Compare
henrygd
approved these changes
Aug 11, 2026
henrygd
left a comment
Owner
There was a problem hiding this comment.
Perfect, thanks! Tested and it's working as intended.
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.
📃 Description
Fixes redirect-based OAuth login when
OAUTH_DISABLE_POPUP=trueis set. Two defects prevented the redirect flow from completing:redirect_uriparameter was commented out of the OAuth authorization request, producing a malformed request and aredirect_urimismatch at the code-exchange step.stateverification and the PKCEcodeVerifier), was persisted insessionStorage, which is tab-scoped. When the OAuth callback is delivered in a new browsing context - as happens with e.g. Authelia - the stored provider is missing and state verification always fails.Both changes are confined to
auth-form.tsx.Fixes #2170
📖 Documentation
N/A — no documentation changes required.
🪵 Changelog
🔧 Fixed
redirect_uriparameter on the OAuth authorization redirect URL so redirect-based login (OAUTH_DISABLE_POPUP=true) works.Store OAuth redirect provider state in
localStorageinstead ofsessionStorage, so the callback succeeds when delivered in a new browsing context.Clean up the stored provider entry and strip the OAuth callback parameters from the URL on both the success and failure paths.
📷 Screenshots
N/A — no visual/UI changes.