POC / DO NOT MERGE: feat(fxa-settings): add account switcher behind a feature flag - #21226
Draft
vpomerleau wants to merge 1 commit into
Draft
vpomerleau wants to merge 1 commit into
vpomerleau wants to merge 1 commit into
Conversation
Because: * Users with several accounts on a device can only reach one of them, and the only way to switch was to sign out first. * localStorage already holds every signed-in account plus a current-account pointer, so only the UI was missing. This commit: * Adds AccountSwitcher, offered on the cached sign-in page and in the settings avatar menu. * Ranks stored accounts by RP-requested email, then the browser's own account, then the current one, then recency. * Signs in as the chosen account on selection instead of re-ranking the list. * Mirrors the browser's signed-in uid to localStorage so both surfaces can badge which account Firefox uses. * Gates all of the above on a new accountSwitcherEnabled flag, off by default and on in local dev.
vpomerleau
force-pushed
the
feature-account-switcher-exploration
branch
from
September 15, 2026 22:12
638a530 to
ccf0618
Compare
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.
Because
This pull request
AccountSwitcherchooser to the cached sign-in page and to the settings avatar menu.?email=cannot make another user's cached account the one-click default on a shared device.accountSwitcherEnabledflag, off by default and on in local dev.Issue that this pull request solves
Closes: N/A
Checklist
Put an
xin the boxes that applyHow to review (Optional)
lib/account-switcher/rank-accounts.ts,pages/Signin/components/SigninCached/index.tsx,components/Settings/DropDownAvatarMenu/index.tsxApp/index.tsxuid mirroringautoSignInonSigninCached;setCurrentAccountUidis written before the target session is validatedScreenshots (Optional)
Other information (Optional)
Proof of concept, not for merge. No Jira ticket yet.
Security review run on this branch. Remaining low findings, left as-is for the POC:
setCurrentAccountUidis set optimistically before the target session is confirmed valid./signin?email=…, putting an email address in the URL.