* fix(dashboard): respect URL tenant org for multi-org students
When a student belongs to multiple organizations, setOrgStore was falling
back to localStorage or the first /account organization even on tenant
sites (subdomain or custom domain). That overwrote the server-resolved
org from the URL and sent the wrong cio-org-id on API calls.
Pin currentOrg to the URL tenant on org sites, preserve the server org
when membership is missing, sync org from /org/[slug] routes, and fix
the goToLMS single-org length check.
Co-authored-by: Rotimi Best <[email protected]>
* fix(dashboard): update currentOrg when switching tenant sites
Address Greptile P1: shouldSetPublicOrg only ran when the site name
matched, so navigating from one tenant subdomain to another left the
previous org in currentOrg. React to URL tenant changes in an effect
and re-pin via setOrgStore when account data is already loaded.
Co-authored-by: Rotimi Best <[email protected]>
* fix(dashboard): harden tenant sync when switching org sites
- Reset globalStore when leaving a tenant URL
- Split org-site seeding from account-backed tenant sync
- Add syncTenantOrgFromUrl with deduping and auto-enroll on switch
- Stop calling setOrgStore directly from the root layout
Co-authored-by: Rotimi Best <[email protected]>
* refactor(dashboard): consolidate org context sync in root layout
Address PR review: document why post-setup sync is needed, merge setupApp
and syncOrgContext into one effect, resolve /org/[slug] from the root
layout via resolveAppOrgParams, and remove duplicate sync from org slug layout.
Co-authored-by: Rotimi Best <[email protected]>
---------
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Rotimi Best <[email protected]>