Back to journals
Loading article…
Journals
Short notes and snippets — too brief for a full blog post, worth writing down.
Back to journals
Back to journals
TIL
Invites, roles, and active-org context slot cleanly into TanStack Router beforeLoad guards.
Date published
## Guard routes with org context
```ts
beforeLoad: async ({ context }) => {
if (!context.context.viewer?.activeOrganization) {
throw redirect({ to: "/orgs" });
}
},
```
Organization state lives in the session — no parallel auth system needed.