Browse Source

Make sure the `ImplementationType` is `RemoteAuthenticationService`

pull/19479/head
maliming 3 years ago
parent
commit
c4dde78f89
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 6
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs

6
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs

@ -3,6 +3,7 @@ using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Volo.Abp.AspNetCore.Components.Web;
@ -52,7 +53,10 @@ public class AbpAspNetCoreComponentsWebAssemblyModule : AbpModule
public override void PostConfigureServices(ServiceConfigurationContext context)
{
var msAuthenticationStateProvider = context.Services.FirstOrDefault(x => x.ServiceType == typeof(AuthenticationStateProvider));
if (msAuthenticationStateProvider != null && msAuthenticationStateProvider.ImplementationType != null)
if (msAuthenticationStateProvider != null &&
msAuthenticationStateProvider.ImplementationType != null &&
msAuthenticationStateProvider.ImplementationType.IsGenericType &&
msAuthenticationStateProvider.ImplementationType.GetGenericTypeDefinition() == typeof(RemoteAuthenticationService<,,>))
{
var webAssemblyAuthenticationStateProviderType = typeof(WebAssemblyAuthenticationStateProvider<,,>).MakeGenericType(
msAuthenticationStateProvider.ImplementationType.GenericTypeArguments[0],

Loading…
Cancel
Save