Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature Request: Expose a method to change auth tenant at runtime #2717

joelmeaders started this conversation in Ideas
Discussion options

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.

  1. 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
  2. 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;
You must be logged in to vote

Replies: 1 comment

This comment has been hidden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
Converted from issue

This discussion was converted from issue #2717 on December 12, 2020 01:59.

AltStyle によって変換されたページ (->オリジナル) /