Skip to content

web: remove legacy storage key migrations - #27036

Draft
GirlBossRush wants to merge 6 commits into
mainfrom
web/remove-remember-me-legacy-session
Draft

GirlBossRush wants to merge 6 commits into
mainfrom
web/remove-remember-me-legacy-session

Conversation

@GirlBossRush

@GirlBossRush GirlBossRush commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

This PR drops the storage migrations that #25205 adds. That PR moves the remember-me username and the library view mode from their old keys to new `ak:`-prefixed ones, and deletes the old remember-me session ID while it's at it. By 2027.2 those have had long enough to run, so `RememberMeStorage.migrate()`, the library view mode migration, `StorageAccessor.migrateFrom` and the tests covering them can all go. Anyone who skips straight past that window just loses their remembered username and view mode once -- not the end of the world.

Draft until #25205 merges and 2027.2 opens -- this is stacked on it, so the diff shows those commits too until then. Only the last commit is new.

Testing: unit suite passes.

@netlify

netlify Bot commented Oct 20, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 71c6d1a
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6ad6cc063b4b1addc0312d40
😎 Deploy Preview https://deploy-preview-27036--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 Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.36%. Comparing base (a749575) to head (cf418a7).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #27036   +/-   ##
=======================================
  Coverage   92.36%   92.36%           
=======================================
  Files        1188     1188           
  Lines       80005    80005           
  Branches     4351     4351           
=======================================
+ Hits        73893    73894    +1     
+ Misses       6046     6045    -1     
  Partials       66       66           
Flag Coverage Δ
conformance 32.29% <ø> (+<0.01%) ⬆️
e2e 36.99% <ø> (+<0.01%) ⬆️
integration 29.17% <ø> (+<0.01%) ⬆️
rust 44.42% <ø> (ø)
unit 94.01% <ø> (+<0.01%) ⬆️
unit-migrate 94.01% <ø> (+<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 Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Playwright e2e

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

gh run download 39362778595 -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-cf418a7ea736b623f72d6551fc7fd3e2f811cbf3
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-cf418a7ea736b623f72d6551fc7fd3e2f811cbf3

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

@GirlBossRush
GirlBossRush force-pushed the web/remove-remember-me-legacy-session branch from 71c6d1a to cd1193f Compare October 20, 2026 02:39
@GirlBossRush GirlBossRush changed the title web/flow: remove legacy remember-me session cleanup web: remove legacy storage key migrations Oct 20, 2026
GirlBossRush and others added 4 commits October 20, 2026 03:48
Split #common/storage into an accessor and shared types, and require
storage keys to use the ak: prefix via a PersistenceKey type. Values
under the old remember-me and library view mode keys are moved to the
new keys on load, so returning users keep their remembered username and
layout. The migrations are marked for removal in 2027.2 (#27036).

Remove ShowHintController, which has had no users since #21781.
The remembered username was keyed to a session ID derived from the CSRF
token, and cleared whenever the two didn't match. Django rotates the
CSRF token on every successful login, so the check failed on every
later visit and the username was always forgotten. Drop the check, so
the username is only cleared by switching the toggle off or following
"Not you?", and discard the session ID left by earlier versions.

Co-authored-by: Shawn O'Dell <[email protected]>
The remember-me input listener was only attached from the toggle's change
handler, so a returning user, who arrives with the switch already checked,
never had it bound. A different user on the same device could type and
submit their own username without it ever reaching localStorage, leaving
the previous username prefilled forever, and auto-submitted in
identification-only flows.

Track whether the feature is on, seeded from the persisted value, and
reconcile the listener when the controller connects and after each update.
The stage adds the controller after it has rendered, so a further update
isn't guaranteed. Cancel a pending keystroke write when the listener is
detached, so switching the toggle off can't be undone by a write queued in
the same frame. Disconnect the controller before the stage removes it,
since removeController doesn't notify it and the listener would otherwise
keep recording after the server turns remember-me off.

Co-authored-by: Shawn O'Dell <[email protected]>
canAutoSubmit only checked whether a username was remembered when the
page loaded, so a returning user who switched the toggle off was kept
from being auto-submitted only by the one-shot attempt counter. Also
require the feature to still be on. Checking only the live toggle state
would instead auto-submit first-time visitors as soon as they opted in.
@GirlBossRush
GirlBossRush force-pushed the web/remove-remember-me-legacy-session branch from cd1193f to e654262 Compare October 20, 2026 02:50
The API answers before the worker has applied the default blueprints.
Until then `/` redirects to an authentication flow that doesn't exist
yet and 404s, so the availability check could fail on a slow start and
skip the whole suite. Poll until the redirect chain resolves, and run
the setup steps serially so the login step waits on it too.
Drop the migrations that moved values from the pre-ak: storage keys,
along with the legacy remember-me session ID cleanup and the
StorageAccessor.migrateFrom helper they used.
@GirlBossRush
GirlBossRush force-pushed the web/remove-remember-me-legacy-session branch from e654262 to cf418a7 Compare October 20, 2026 03:09
GirlBossRush added a commit that referenced this pull request Oct 20, 2026
* web: namespace storage keys and migrate legacy values

Split #common/storage into an accessor and shared types, and require
storage keys to use the ak: prefix via a PersistenceKey type. Values
under the old remember-me and library view mode keys are moved to the
new keys on load, so returning users keep their remembered username and
layout. The migrations are marked for removal in 2027.2 (#27036).

Remove ShowHintController, which has had no users since #21781.

* web/flow: fix remember-me being cleared by CSRF token rotation

The remembered username was keyed to a session ID derived from the CSRF
token, and cleared whenever the two didn't match. Django rotates the
CSRF token on every successful login, so the check failed on every
later visit and the username was always forgotten. Drop the check, so
the username is only cleared by switching the toggle off or following
"Not you?", and discard the session ID left by earlier versions.

Co-authored-by: Shawn O'Dell <[email protected]>

* web/flow: bind remember-me keystroke listener for returning users

The remember-me input listener was only attached from the toggle's change
handler, so a returning user, who arrives with the switch already checked,
never had it bound. A different user on the same device could type and
submit their own username without it ever reaching localStorage, leaving
the previous username prefilled forever, and auto-submitted in
identification-only flows.

Track whether the feature is on, seeded from the persisted value, and
reconcile the listener when the controller connects and after each update.
The stage adds the controller after it has rendered, so a further update
isn't guaranteed. Cancel a pending keystroke write when the listener is
detached, so switching the toggle off can't be undone by a write queued in
the same frame. Disconnect the controller before the stage removes it,
since removeController doesn't notify it and the listener would otherwise
keep recording after the server turns remember-me off.

Co-authored-by: Shawn O'Dell <[email protected]>

* web/flow: respect the remember-me toggle when auto-submitting

canAutoSubmit only checked whether a username was remembered when the
page loaded, so a returning user who switched the toggle off was kept
from being auto-submitted only by the one-shot attempt counter. Also
require the feature to still be on. Checking only the live toggle state
would instead auto-submit first-time visitors as soon as they opted in.

* web/e2e: wait for the login flow before running browser tests

The API answers before the worker has applied the default blueprints.
Until then `/` redirects to an authentication flow that doesn't exist
yet and 404s, so the availability check could fail on a slow start and
skip the whole suite. Poll until the redirect chain resolves, and run
the setup steps serially so the login step waits on it too.

---------

Co-authored-by: Teffen Ellis <[email protected]>

This branch has not been deployed

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

1 participant