From 390162505b7335c069b4b6216748577c2fa61179 Mon Sep 17 00:00:00 2001 From: EngincanV Date: Mon, 26 Aug 2024 16:31:34 +0300 Subject: [PATCH] Update AbpDynamicClaimsMiddleware.cs --- .../Security/Claims/AbpDynamicClaimsMiddleware.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/Claims/AbpDynamicClaimsMiddleware.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/Claims/AbpDynamicClaimsMiddleware.cs index a502f2f886..b2bbb78e7b 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/Claims/AbpDynamicClaimsMiddleware.cs +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Security/Claims/AbpDynamicClaimsMiddleware.cs @@ -22,11 +22,11 @@ public class AbpDynamicClaimsMiddleware : AbpMiddlewareBase, ITransientDependenc var authenticateResultFeature = context.Features.Get(); var authenticationType = authenticateResultFeature?.AuthenticateResult?.Ticket?.AuthenticationScheme ?? context.User.Identity.AuthenticationType; - var abpClaimsPrincipalFactory = context.RequestServices.GetRequiredService(); - var user = await abpClaimsPrincipalFactory.CreateDynamicAsync(context.User); - if (authenticateResultFeature != null && !authenticationType.IsNullOrWhiteSpace()) { + var abpClaimsPrincipalFactory = context.RequestServices.GetRequiredService(); + var user = await abpClaimsPrincipalFactory.CreateDynamicAsync(context.User); + authenticateResultFeature.AuthenticateResult = AuthenticateResult.Success(new AuthenticationTicket(user, authenticationType)); var httpAuthenticationFeature = context.Features.Get(); if (httpAuthenticationFeature != null)