Repository navigation
web: remove legacy storage key migrations - #27036
Draft
GirlBossRush wants to merge 6 commits into
Draft
GirlBossRush wants to merge 6 commits into
GirlBossRush wants to merge 6 commits into
Conversation
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Contributor
Playwright e2eDownload 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-reportInstallation instructionsInstructions for docker-composeAdd the following block to your 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)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your 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-cf418a7ea736b623f72d6551fc7fd3e2f811cbf3Afterwards, run the upgrade commands from the latest release notes. |
GirlBossRush
force-pushed
the
web/remove-remember-me-legacy-session
branch
from
October 20, 2026 02:39
71c6d1a to
cd1193f
Compare
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
force-pushed
the
web/remove-remember-me-legacy-session
branch
from
October 20, 2026 02:50
cd1193f to
e654262
Compare
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
force-pushed
the
web/remove-remember-me-legacy-session
branch
from
October 20, 2026 03:09
e654262 to
cf418a7
Compare
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
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.
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.