Skip to content

web/flows: check if localStorage is available for continuous login - #26267

Merged
BeryJu merged 1 commit into
mainfrom
web/flows/check-local-storage
Oct 2, 2026
Merged

BeryJu merged 1 commit into
mainfrom
web/flows/check-local-storage

Conversation

@BeryJu

@BeryJu BeryJu commented Sep 18, 2026

Copy link
Copy Markdown
Member

localStorage is not available in MinuteMaid (Android google account setup)

@BeryJu
BeryJu requested a review from a team as a code owner September 18, 2026 13:37
@netlify

netlify Bot commented Sep 18, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit d6ae99e
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6aad3e9816931200083d35c2
😎 Deploy Preview https://deploy-preview-26267--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.97%. Comparing base (bafc5e1) to head (d6ae99e).
⚠️ Report is 190 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26267      +/-   ##
==========================================
- Coverage   92.00%   91.97%   -0.04%     
==========================================
  Files        1175     1175              
  Lines       76288    76288              
  Branches     4056     4056              
==========================================
- Hits        70192    70166      -26     
- Misses       6054     6080      +26     
  Partials       42       42              
Flag Coverage Δ
conformance 33.49% <ø> (ø)
e2e 38.26% <ø> (+<0.01%) ⬆️
integration 29.78% <ø> (-0.45%) ⬇️
rust 42.89% <ø> (ø)
unit 93.56% <ø> (+<0.01%) ⬆️
unit-migrate 93.57% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Playwright e2e

Download this run's HTML report, traces and server logs, then open the report:

gh run download 35351301629 -D playwright-artifacts
npx playwright show-report playwright-artifacts/playwright-report

Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-d6ae99e77169c0115e5e7c427529a3ee49d76b12
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-d6ae99e77169c0115e5e7c427529a3ee49d76b12

Afterwards, run the upgrade commands from the latest release notes.

@BeryJu BeryJu added backport/version-2026.5 Add this label to PRs to backport changes to version-2026.5 backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8 labels Oct 2, 2026
@BeryJu
BeryJu merged commit 9ce114c into main Oct 2, 2026
146 checks passed
@BeryJu
BeryJu deleted the web/flows/check-local-storage branch October 2, 2026 10:35
@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

🍒 Cherry-pick to version-2026.8 created: #26638

@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

🍒 Cherry-pick to version-2026.5 created: #26639

BeryJu added a commit that referenced this pull request Oct 2, 2026
…herry-pick #26267 to version-2026.8) (#26638)

web/flows: check if localStorage is available for continuous login (#26267)

Co-authored-by: Jens L. <[email protected]>
BeryJu added a commit that referenced this pull request Oct 2, 2026
…herry-pick #26267 to version-2026.5) (#26639)

web/flows: check if localStorage is available for continuous login (#26267)

Co-authored-by: Jens L. <[email protected]>
GirlBossRush pushed a commit to dpitts03/authentik that referenced this pull request Oct 27, 2026
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.
GirlBossRush pushed a commit to dpitts03/authentik that referenced this pull request Oct 27, 2026
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.
GirlBossRush pushed a commit to dpitts03/authentik that referenced this pull request Oct 27, 2026
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.
GirlBossRush added a commit that referenced this pull request Oct 27, 2026
* never let continuous login block the final redirect

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).

- 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.

* web/flow: elect continuous-login resume leader with a Web Lock

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.

* web/test: cover continuous-login multi-tab resume

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.

* Refine comments.

* web/test: align continuous-login e2e with suite conventions

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.

* web/test: pad the continuous-login visibility assertions

* web/flow: rework continuous-login unit tests around the Web Lock

* web/test: wait for each tab to see the continuous-login flag

* web: share server-context document readers via @goauthentik/core/document

* web/flow: share a brand injection helper across continuous-login tests

* Clean up comment.

---------

Co-authored-by: Teffen Ellis <[email protected]>
Co-authored-by: Teffen Ellis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/version-2026.5 Add this label to PRs to backport changes to version-2026.5 backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant