From aaaeefc722b3e379f6a165585f876c0f9c37065b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 20 Jun 2019 11:21:40 +0300 Subject: [PATCH 1/3] Redirect to Account/Login URL rather than the page. --- .../src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml index f604ef40a7..523160a18d 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml @@ -126,7 +126,7 @@ } else { - @L["LeaveComment"] + @L["LeaveComment"] } @@ -317,7 +317,7 @@ } else { - @L["LeaveComment"] + @L["LeaveComment"] } From ea549b4305e9bc3291eb06b3191f165edf2d8228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 20 Jun 2019 11:40:16 +0300 Subject: [PATCH 2/3] Fix AbpClaimActionCollectionExtensions.MapAbpClaimTypes --- .../AbpClaimActionCollectionExtensions.cs | 37 +++++++++++++++---- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs index dbaacb6949..f51706113a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs @@ -7,16 +7,37 @@ namespace Microsoft.AspNetCore.Authentication.OAuth.Claims { public static void MapAbpClaimTypes(this ClaimActionCollection claimActions) { - claimActions.MapJsonKey(AbpClaimTypes.Email, "email"); - claimActions.MapJsonKey(AbpClaimTypes.UserName, "name"); - claimActions.MapJsonKey(AbpClaimTypes.EmailVerified, "email_verified"); - claimActions.MapJsonKey(AbpClaimTypes.PhoneNumber, "phone_number"); - claimActions.MapJsonKey(AbpClaimTypes.PhoneNumberVerified, "phone_number_verified"); + if (AbpClaimTypes.UserName != "name") + { + claimActions.MapJsonKey(AbpClaimTypes.UserName, "name"); + claimActions.DeleteClaim("name"); + } - claimActions.MapJsonKeyMultiple(AbpClaimTypes.Role, "role"); + if (AbpClaimTypes.Email != "email") + { + claimActions.MapJsonKey(AbpClaimTypes.Email, "email"); + claimActions.DeleteClaim("email"); + } - claimActions.DeleteClaim("name"); - claimActions.DeleteClaim("email"); + if (AbpClaimTypes.EmailVerified != "email_verified") + { + claimActions.MapJsonKey(AbpClaimTypes.EmailVerified, "email_verified"); + } + + if (AbpClaimTypes.PhoneNumber != "phone_number") + { + claimActions.MapJsonKey(AbpClaimTypes.PhoneNumber, "phone_number"); + } + + if (AbpClaimTypes.PhoneNumberVerified != "phone_number_verified") + { + claimActions.MapJsonKey(AbpClaimTypes.PhoneNumberVerified, "phone_number_verified"); + } + + if (AbpClaimTypes.Role != "role") + { + claimActions.MapJsonKeyMultiple(AbpClaimTypes.Role, "role"); + } } public static void MapJsonKeyMultiple(this ClaimActionCollection claimActions, string claimType, string jsonKey) From fc32bf839533e89a2c567f5be2d7acad7c2fc3fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Thu, 20 Jun 2019 12:03:28 +0300 Subject: [PATCH 3/3] Update Detail.cshtml --- .../src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml index 523160a18d..4b7250ecb0 100644 --- a/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml +++ b/modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml @@ -126,7 +126,7 @@ } else { - @L["LeaveComment"] + @L["LeaveComment"] } @@ -317,7 +317,7 @@ } else { - @L["LeaveComment"] + @L["LeaveComment"] }