Hey all, working on a SvelteKit app with Better-auth and ZenStack v3 and trying to figure out the best approach for a multi-tenant style auth flow.
Users can belong to multiple "households" and each household has multiple profiles (think family members). After sign-in I need a second step where the user picks which household they're in and then which profile they're using — similar to how Netflix or Slack handle workspace/profile switching. If they only have one household and one profile just skip straight through.
The active household ID and profile ID then need to be available throughout the app to scope all data access via ZenStack.
My questions are:
What's the best way to store the active household + profile context after sign-in — session, cookie, something else?
Is there a recommended pattern for that post-login selection step in SvelteKit — middleware, a dedicated route, a layout?
Any gotchas with Better-auth + ZenStack v3 when passing custom context like this down to the access control layer?
Cheers