refinement phase 2
This commit is contained in:
@@ -19,9 +19,11 @@ const ROLE_PRECEDENCE: AppRole[] = [APP_ROLES.ADMIN, APP_ROLES.NURSE, APP_ROLES.
|
||||
/**
|
||||
* The actor experience the current session should see, read from the session roles.
|
||||
*
|
||||
* Roles are seeded by the server in f1-b2; until then sessions carry no roles and
|
||||
* this returns DEFAULT_ROLE (customer) so the shells degrade gracefully. Route-group
|
||||
* layouts use it to drive role-aware navigation and (later) access guards.
|
||||
* Chrome-only signal: which nav/shell the shells build from the collapsed session roles. The DEFAULT_ROLE
|
||||
* (customer) fallback is a **last resort**, not the loading state — the shells are wrapped in `RoleGuard`
|
||||
* (refinement-phase-2), which holds a neutral splash until `/me` resolves and redirects a role mismatch, so
|
||||
* this is only ever read once the roles are hydrated. Never gate "which app" on this fallback; that decision
|
||||
* is `resolveRoleDestination` (via `RoleGuard`/`RoleRouter`), the single source of truth.
|
||||
*/
|
||||
export function useActorRole(): AppRole {
|
||||
const [state] = useAuth();
|
||||
|
||||
Reference in New Issue
Block a user