fix: handle access_token only response from switchContext

This commit is contained in:
Usman Baig
2026-01-22 01:36:56 +01:00
parent 806b149bc7
commit cbb2255024
5 changed files with 23 additions and 17 deletions

View File

@@ -28,10 +28,11 @@ export default function WorkspaceSwitcher({ orgs, activeOrgId }: { orgs: Organiz
return
}
const { token, refresh_token } = await switchContext(orgId)
const { access_token } = await switchContext(orgId)
// * Update session cookie via server action
await setSessionAction(token, refresh_token)
// * Note: switchContext only returns access_token, we keep existing refresh token
await setSessionAction(access_token)
// Force reload to pick up new permissions
window.location.reload()