From 1f65d47811c26c67e5067502b66c7d03211cb367 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Thu, 1 Feb 2024 15:47:03 -0500 Subject: [PATCH] use new Cascading Authentication State Services --- .../Extensions/OqtaneServiceCollectionExtensions.cs | 1 + Oqtane.Client/Routes.razor | 8 +++----- Oqtane.Server/Startup.cs | 3 +++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Oqtane.Client/Extensions/OqtaneServiceCollectionExtensions.cs b/Oqtane.Client/Extensions/OqtaneServiceCollectionExtensions.cs index bc1d4780..ce563a13 100644 --- a/Oqtane.Client/Extensions/OqtaneServiceCollectionExtensions.cs +++ b/Oqtane.Client/Extensions/OqtaneServiceCollectionExtensions.cs @@ -10,6 +10,7 @@ namespace Microsoft.Extensions.DependencyInjection public static IServiceCollection AddOqtaneAuthorization(this IServiceCollection services) { services.AddAuthorizationCore(); + services.AddCascadingAuthenticationState(); services.AddScoped(); services.AddScoped(s => s.GetRequiredService()); diff --git a/Oqtane.Client/Routes.razor b/Oqtane.Client/Routes.razor index 16c99c52..932b957e 100644 --- a/Oqtane.Client/Routes.razor +++ b/Oqtane.Client/Routes.razor @@ -14,11 +14,9 @@ @if (string.IsNullOrEmpty(_installation.Message)) {
- - - - - + + +
} else diff --git a/Oqtane.Server/Startup.cs b/Oqtane.Server/Startup.cs index c0b48575..eb625a52 100644 --- a/Oqtane.Server/Startup.cs +++ b/Oqtane.Server/Startup.cs @@ -108,6 +108,9 @@ namespace Oqtane services.ConfigureOqtaneIdentityOptions(Configuration); + services.AddCascadingAuthenticationState(); + services.AddAuthorization(); + services.AddAuthentication(options => { options.DefaultScheme = Constants.AuthenticationScheme;