Low priority / nice to have.
Context
Today the app holds exactly one session at a time. Signing into another account replaces the current one, and switching back means signing out and signing in again. This is especially visible with the demo session: entering the demo blows away an existing login (see the "you are currently logged in, switch to demo?" prompt in apps/app/src/routes/{-$locale}/demo.tsx).
Proposal
Support several authenticated accounts side by side in the browser, like the Google account switcher:
- Keep multiple valid sessions simultaneously.
- An account switcher in the dashboard user menu listing every signed-in account, with the active one marked.
- "Add another account" → sign-in flow that adds a session instead of replacing the current one.
- Sign out of one account without dropping the others.
- The demo session becomes just another entry in the list, so trying the demo no longer kicks you out of your real account.
Implementation notes
- The backend already runs
better-auth 1.6.29 (apps/backend/src/utils/auth/getAuth.ts, currently with the customSession, passkey and sso plugins). better-auth ships a multiSession plugin that covers the storage/cookie side, so this is mostly plugin wiring + UI.
- Client side, the session is read through
sessionQueryOptions (apps/app/src/utils/auth.tsx); the switcher will need to invalidate/refetch on account change, and the active organization / active project resolution must follow the newly active account.
- UI belongs in
@intlayer/design-system so both the dashboard and the visual editor can use it.
Acceptance criteria
Context
Today the app holds exactly one session at a time. Signing into another account replaces the current one, and switching back means signing out and signing in again. This is especially visible with the demo session: entering the demo blows away an existing login (see the "you are currently logged in, switch to demo?" prompt in
apps/app/src/routes/{-$locale}/demo.tsx).Proposal
Support several authenticated accounts side by side in the browser, like the Google account switcher:
Implementation notes
better-auth1.6.29 (apps/backend/src/utils/auth/getAuth.ts, currently with thecustomSession,passkeyandssoplugins). better-auth ships amultiSessionplugin that covers the storage/cookie side, so this is mostly plugin wiring + UI.sessionQueryOptions(apps/app/src/utils/auth.tsx); the switcher will need to invalidate/refetch on account change, and the active organization / active project resolution must follow the newly active account.@intlayer/design-systemso both the dashboard and the visual editor can use it.Acceptance criteria