Browse Source

Merge branch 'dev' of https://github.com/volosoft/abp into dev

pull/1331/head
Yunus Emre Kalkan 7 years ago
parent
commit
a800712e54
  1. 37
      framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs
  2. 4
      modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml

37
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)

4
modules/blogging/src/Volo.Blogging.Web/Pages/Blog/Posts/Detail.cshtml

@ -126,7 +126,7 @@
}
else
{
<a abp-button="Primary" class="btn-rounded float-right active" asp-page="/Account/Login" target="_blank">@L["LeaveComment"]</a>
<a abp-button="Primary" class="btn-rounded float-right active" href="/Account/Login?returnUrl=@Request.GetEncodedPathAndQuery()">@L["LeaveComment"]</a>
}
</abp-column>
</abp-row>
@ -317,7 +317,7 @@
}
else
{
<a abp-button="Primary" class="btn-rounded float-right active mt-3" asp-page="/Account/Login" target="_blank">@L["LeaveComment"]</a>
<a abp-button="Primary" class="btn-rounded float-right active mt-3" href="/Account/Login?returnUrl=@Request.GetEncodedPathAndQuery()">@L["LeaveComment"]</a>
}
</div>
</div>

Loading…
Cancel
Save