globalContext, Zustand/React context, or cookie) is not fully flushed on switch. Needs investigation to confirm.src/actions/switchCompany.ts — Primary entry point for the company switch action; the most likely location where session state is updated or where a flush/reset should be triggered.src/app/tools/globalContext.tsx and src/app/admin/globalContext.tsx — Global context providers; if company identity is held here, these need to ensure stale state is cleared before re-render on switch.src/app/tools/notifications/switch-membership/page.tsx — Handles the membership switch notification flow; relevant if switch triggers a redirect that races with session resolution.src/components/navbar/NavUser.tsx — Navbar company switcher UI; relevant if the switch action is initiated here.src/util/functions/betterAuth/auth.ts — Core auth configuration; relevant for understanding how company/session context is scoped per request.src/util/functions/betterAuth/shared/sessionHelpers.ts — Session helper utilities; likely involved in resolving or updating the active company on the session.src/util/functions/betterAuth/web/webAuthEndpoints.ts — Web auth endpoints; relevant if the company switch posts to or relies on an auth endpoint to re-establish context.src/routes/session.ts and src/routes/authenticate.ts — Session and authentication route handlers; relevant for understanding the full login + company resolution flow.Please authenticate to join the conversation.
Planned
Main App
About 5 hours ago
Linear
Get notified by email when there are changes.
Planned
Main App
About 5 hours ago
Linear
Get notified by email when there are changes.