Skip to content

feat(auth): adapt web multi session approach [AI]#372

Open
mbeernut wants to merge 14 commits into
mainfrom
feat/MPT-18445-support-multi-account-aproach
Open

feat(auth): adapt web multi session approach [AI]#372
mbeernut wants to merge 14 commits into
mainfrom
feat/MPT-18445-support-multi-account-aproach

Conversation

@mbeernut
Copy link
Copy Markdown
Contributor

@mbeernut mbeernut commented May 11, 2026

Multi-account support (FEATURE_MULTI_ACCOUNT)

  • Token refresh with account context — replaced library refreshToken() call with a direct JSON fetch to pass marketplaceAccountId to the Auth0 Action; the library silently drops additionalParameters so a custom fetch was the only option
  • Feature flag stability — added an early return for fullVersion === '' in featureFlagsService to prevent the flag from falsely disabling during portal version loading
  • Legacy account sync — added useLegacyAccountSync hook: when the feature flag is off, detects web-side account changes by watching the JWT accountId claim after each token refresh and invalidates userData/spotlightData queries accordingly
  • Account switcher visibility fix — AccountToolbarButton now falls back to userAccountsData keyed by currentAccountId when userData?.currentAccount is null (loading or post-switch query clear), keeping the avatar visible and the button tappable
  • Account list data fix — useUserAccountsData was calling getAccountsForUser (?select=groups,audit, no display fields) instead of getUserAccountsData (?select=id,name,icon,...); accounts now load with all fields needed for the list and toolbar avatar
  • Repeated-switch guard fix — ProfileScreen initialises selectedAccountId from currentAccountId and uses selectedAccountId ?? currentAccountId in the guard, preventing no-op switches when the account ID is still loading on first render

@mbeernut mbeernut changed the title Feat/mpt 18445 support multi account aproach feat(auth): adapt web multi session approach [AI] May 11, 2026
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