Browse Source

Merge pull request #19950 from abpframework/auto-merge/rel-8-2/2753

Merge branch dev with rel-8.2
pull/19959/head
maliming 2 years ago
committed by GitHub
parent
commit
9bc3b9b28c
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 12
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/Claims/AbpDynamicClaimsMiddleware.cs

12
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/Claims/AbpDynamicClaimsMiddleware.cs

@ -24,19 +24,15 @@ public class AbpDynamicClaimsMiddleware : AbpMiddlewareBase, ITransientDependenc
if (context.User.Identity?.IsAuthenticated == false) if (context.User.Identity?.IsAuthenticated == false)
{ {
var authenticationSchemeProvider = context.RequestServices.GetRequiredService<IAuthenticationSchemeProvider>();
if (!authenticationType.IsNullOrWhiteSpace()) if (!authenticationType.IsNullOrWhiteSpace())
{ {
var authenticationSchemeProvider = context.RequestServices.GetRequiredService<IAuthenticationSchemeProvider>(); var authenticationScheme = await authenticationSchemeProvider.GetSchemeAsync(authenticationType);
var scheme = await authenticationSchemeProvider.GetSchemeAsync(authenticationType); if (authenticationScheme != null && typeof(IAuthenticationSignOutHandler).IsAssignableFrom(authenticationScheme.HandlerType))
if (scheme != null)
{ {
await context.SignOutAsync(scheme.Name); await context.SignOutAsync(authenticationScheme.Name);
} }
} }
else
{
await context.SignOutAsync();
}
} }
} }
} }

Loading…
Cancel
Save