Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor support - cascading TenantInfo parameter #49

Open
dazinator opened this issue May 16, 2019 · 1 comment
Open

Blazor support - cascading TenantInfo parameter #49

dazinator opened this issue May 16, 2019 · 1 comment
Labels

Comments

@dazinator
Copy link
Owner

dazinator commented May 16, 2019

See cascading parameter concept in Blazor : https://github.com/dotnet-presentations/blazor-workshop/blob/master/docs/05-authentication-and-authorization.md

Dotnettency could offer a similar cascading parameter to allow access to the current TTenant information retrieved from the server.

@dazinator
Copy link
Owner Author

Support for this could be added to a Donettency.Spa.Blazor package.
Similar to CascadingAuthenticationState component, you could use CascadingTenantState component. This component would be configured in startup.cs to obtain current tenant information (generic TTenantInfo) from either:

  1. GET request to some configurable path that returns TTenantInfo as Json.
  2. Http client RequestDelegatingHandler that can intercept the response from the server and deserialise TTenantInfo from a header in the response containing Json.

2 is a stretch goal. Awaiting the cascaded Task<TenantInfo> in blazor , would cause a request to the server using option 1 if the task hasn't run before. Task is reused so this would only happen once unless invalidated.

@dazinator dazinator changed the title Blazor support - cascading parameter Blazor support - cascading TenantInfo parameter Aug 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant