-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Feature Request: Expose a method to change auth tenant at runtime #2717
joelmeaders
started this conversation in
Ideas
-
Hey there, first of all, many thanks for this great project!
I'd like a way to change the auth tenant at runtime based on dynamic data. I know there's an injection token TENANT_ID but I'd like to support two use cases in particular.
- A user could belong to multiple tenants and they would need to choose the tenant they wish to log into from a menu. Enter Email > Select Tenant > Enter Password > Log In
- Set the tenant based on a navigation event from the Angular Router service.
For the second use case I can get it to partially work (without Router) via the DI token and the method below but it's static and won't react to route changes unless there's a full page reload.
const authTenantFactory = () =>
window.location.pathname.split('/')[2] ?? null;
Beta Was this translation helpful? Give feedback.
All reactions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment