diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.cshtml.cs index a563ba346e..db51f9890c 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Manage.cshtml.cs @@ -29,7 +29,7 @@ namespace Volo.Abp.Account.Web.Pages.Account PersonalSettingsInfoModel = ObjectMapper.Map(user); - DisablePasswordChange = user.IsExternalLoggedIn; + DisablePasswordChange = user.IsExternal; HideOldPasswordInput = !user.HasPassword; return Page(); diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/ProfileDto.cs b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/ProfileDto.cs index 4b97a518db..98469700a9 100644 --- a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/ProfileDto.cs +++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/ProfileDto.cs @@ -14,7 +14,7 @@ namespace Volo.Abp.Identity public string PhoneNumber { get; set; } - public bool IsExternalLoggedIn { get; set; } + public bool IsExternal { get; set; } public bool HasPassword { get; set; } } diff --git a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/AbpIdentityApplicationModuleAutoMapperProfile.cs b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/AbpIdentityApplicationModuleAutoMapperProfile.cs index d4f27f1972..4c28e37f01 100644 --- a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/AbpIdentityApplicationModuleAutoMapperProfile.cs +++ b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/AbpIdentityApplicationModuleAutoMapperProfile.cs @@ -14,8 +14,8 @@ namespace Volo.Abp.Identity .MapExtraProperties(); CreateMap() - .Ignore(x=>x.IsExternalLoggedIn) - .Ignore(x=>x.HasPassword) + .ForMember(dest => dest.HasPassword, + op => op.MapFrom(src => src.PasswordHash != null)) .MapExtraProperties(); } } diff --git a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/ProfileAppService.cs b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/ProfileAppService.cs index 73e438b640..c08eb7ce32 100644 --- a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/ProfileAppService.cs +++ b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/ProfileAppService.cs @@ -23,11 +23,7 @@ namespace Volo.Abp.Identity { var currentUser = await UserManager.GetByIdAsync(CurrentUser.GetId()); - var profile = ObjectMapper.Map(currentUser); - profile.IsExternalLoggedIn = currentUser.IsExternal; - profile.HasPassword = currentUser.PasswordHash != null; - - return profile; + return ObjectMapper.Map(currentUser); } public virtual async Task UpdateAsync(UpdateProfileDto input) @@ -69,7 +65,6 @@ namespace Volo.Abp.Identity if (currentUser.PasswordHash == null) { - (await UserManager.RemovePasswordAsync(currentUser)).CheckErrors(); (await UserManager.AddPasswordAsync(currentUser, input.NewPassword)).CheckErrors(); return;