Repository navigation
web/flows: never let continuous login block the final redirect - #26269
GirlBossRush merged 11 commits into
Conversation
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
d2ec63a to
fab11ea
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26269 +/- ##
==========================================
- Coverage 92.43% 92.40% -0.04%
==========================================
Files 1193 1193
Lines 80838 80838
Branches 4497 4497
==========================================
- Hits 74722 74696 -26
- Misses 6050 6076 +26
Partials 66 66
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
The final redirect awaits continuous-login orchestration and the exit bookkeeping before navigating, so any error or hang there leaves the page on the spinner after the server has already finished the flow. In Google's Android account setup WebView, localStorage is null and the orchestrator throws (goauthentik#23660, goauthentik#26267). - Catch and log orchestration errors in RedirectStage, then always navigate. - Return a copy from discoverTabs(). waitForTabExit() rediscovers while the leader iterates the live Set, and entries re-added during for...of are visited again, so a follower that never exits was resumed forever. - Resolve the wait when rediscovery rejects in the timer callback, and release the tab lock in a finally block.
Replace the hand-rolled localStorage lock — a non-atomic check-then-set guarded by a tab-liveness heuristic — with navigator.locks. `ifAvailable` gives immediate leader election with no double-leader race, and the browser releases the lock on navigation or close, so there is no stale lock to reap and no manual cleanup.
Drive two real tabs in one browser context: authenticate in the leader and assert the follower leaves the identification stage on its own. The global flag is enabled in beforeAll and restored in afterAll; the file carries the highest numeric prefix and runs serially so it does not race the parallel login suite.
Move the global-flag toggle into an e2e/ helper (setInstanceFlag) so the test stops hand-constructing fixtures inline, and confirm the settings save through its success toast instead of matching the settings network response — keeping the flow on the UI like the rest of the suite.
beab5de to
ce2bbe1
Compare
* main: (89 commits) providers/scim: scope-aware adoption (#26174) sources/ldap: respect accountExpires attributes (#26135) web/flows: never let continuous login block the final redirect (#26269) website: document password hash import restrictions (#24235) core: restrict imported password hashers (#24234) core, web: update translations (#27148) server: retry requests on connections closed by a recycled worker (#27275) packages/django-postgres-cache, flows: count cache keys in the database (#25808) events: simplify execution of event rules/notifications (#26873) core: bump github.com/pires/go-proxyproto from 0.15.0 to 0.16.0 (#27260) core: bump goauthentik/platform-ssh from 26.04-ak-0.72.3 to 26.04-ak-0.72.4 in /tests/e2e (#27263) core: bump goauthentik/selenium from 155.0-ak-0.72.3 to 155.0-ak-0.72.4 in /tests/e2e (#27261) core: bump astral-sh/uv from 0.13.5 to 0.13.6 in /lifecycle/container (#27264) core: bump jsonpatch from 1.35 to 1.36 (#27269) outposts: refresh channel groups on hello (#27136) core: bump certifi from 2026.10.19 to 2026.10.23 (#27266) core: bump pluggy from 1.6.0 to v1.7.0 (#27238) core: bump markupsafe from 3.0.3 to v3.0.4 (#27225) core: bump httptools from 0.8.0 to v0.9.0 (#27219) core: bump iniconfig from 2.3.0 to v2.3.1 (#27221) ...
Details
The final redirect awaits continuous-login orchestration and the exit bookkeeping before navigating, so any error or hang there leaves the page on the spinner after the server has already finished the flow. In Google's Android account setup WebView, localStorage is null and the orchestrator throws (#23660, #26267).
Edited by maintainer
This PR ensures continuous-login orchestration can never keep a completed flow from redirecting, and elects the resume leader with the Web Locks API. Continuous login is skipped where
navigator.locksis unavailable (insecure contexts such as plain HTTP). The tab still redirects normally.RedirectStage, then always navigate.localStorageleader lock withnavigator.locks.request(..., { ifAvailable: true }). The browser releases the lock when the leader settles, navigates, or closes.tabs.has(lockTabID)) and the manual lock cleanup.discoverTabs(). Rediscovery mutated the liveSetthe leader was iterating, resuming a lingering follower forever.<meta>andjson_scriptreaders into@goauthentik/core/document, shared by the main bundle and the SFE.injectBrandtest helper with a default brand, replacing the per-file brand setup.Closes #23660, closes #26267. Supersedes #25692.