Merge pull request #3721 from sbwalker/dev
use new Cascading Authentication State Services
This commit is contained in:
commit
1663731489
|
@ -10,6 +10,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
public static IServiceCollection AddOqtaneAuthorization(this IServiceCollection services)
|
||||
{
|
||||
services.AddAuthorizationCore();
|
||||
services.AddCascadingAuthenticationState();
|
||||
services.AddScoped<IdentityAuthenticationStateProvider>();
|
||||
services.AddScoped<AuthenticationStateProvider>(s => s.GetRequiredService<IdentityAuthenticationStateProvider>());
|
||||
|
||||
|
|
|
@ -14,11 +14,9 @@
|
|||
@if (string.IsNullOrEmpty(_installation.Message))
|
||||
{
|
||||
<div style="@_display">
|
||||
<CascadingAuthenticationState>
|
||||
<CascadingValue Value="@PageState">
|
||||
<SiteRouter RenderMode="@RenderMode" Runtime="@Runtime" VisitorId="@VisitorId" OnStateChange="@ChangeState" />
|
||||
</CascadingValue>
|
||||
</CascadingAuthenticationState>
|
||||
<CascadingValue Value="@PageState">
|
||||
<SiteRouter RenderMode="@RenderMode" Runtime="@Runtime" VisitorId="@VisitorId" OnStateChange="@ChangeState" />
|
||||
</CascadingValue>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
|
|
|
@ -108,6 +108,9 @@ namespace Oqtane
|
|||
|
||||
services.ConfigureOqtaneIdentityOptions(Configuration);
|
||||
|
||||
services.AddCascadingAuthenticationState();
|
||||
services.AddAuthorization();
|
||||
|
||||
services.AddAuthentication(options =>
|
||||
{
|
||||
options.DefaultScheme = Constants.AuthenticationScheme;
|
||||
|
|
Loading…
Reference in New Issue
Block a user