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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
8 deletions
-
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) |
|
|
|
{ |
|
|
|
var authenticationSchemeProvider = context.RequestServices.GetRequiredService<IAuthenticationSchemeProvider>(); |
|
|
|
if (!authenticationType.IsNullOrWhiteSpace()) |
|
|
|
{ |
|
|
|
var authenticationSchemeProvider = context.RequestServices.GetRequiredService<IAuthenticationSchemeProvider>(); |
|
|
|
var scheme = await authenticationSchemeProvider.GetSchemeAsync(authenticationType); |
|
|
|
if (scheme != null) |
|
|
|
var authenticationScheme = await authenticationSchemeProvider.GetSchemeAsync(authenticationType); |
|
|
|
if (authenticationScheme != null && typeof(IAuthenticationSignOutHandler).IsAssignableFrom(authenticationScheme.HandlerType)) |
|
|
|
{ |
|
|
|
await context.SignOutAsync(scheme.Name); |
|
|
|
await context.SignOutAsync(authenticationScheme.Name); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
await context.SignOutAsync(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|