Browse Source
Merge pull request #5466 from abpframework/maliming/issue-5460
Remove TwoFactorEnabled related UI & Application Service.
pull/5604/head
Halil İbrahim Kalkan
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with
9 additions and
29 deletions
-
modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserCreateOrUpdateDtoBase.cs
-
modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/IdentityUserDto.cs
-
modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs
-
modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor
-
modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml
-
modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/CreateModal.cshtml.cs
-
modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml
-
modules/identity/src/Volo.Abp.Identity.Web/Pages/Identity/Users/EditModal.cshtml.cs
-
modules/identity/test/Volo.Abp.Identity.Application.Tests/Volo/Abp/Identity/IdentityUserAppService_Tests.cs
-
modules/identity/test/Volo.Abp.Identity.AspNetCore.Tests/Volo/Abp/Identity/AspNetCore/ExternalLoginProvider_Tests.cs
|
|
|
@ -26,8 +26,6 @@ namespace Volo.Abp.Identity |
|
|
|
[DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] |
|
|
|
public string PhoneNumber { get; set; } |
|
|
|
|
|
|
|
public bool TwoFactorEnabled { get; set; } |
|
|
|
|
|
|
|
public bool LockoutEnabled { get; set; } |
|
|
|
|
|
|
|
[CanBeNull] |
|
|
|
@ -35,7 +33,7 @@ namespace Volo.Abp.Identity |
|
|
|
|
|
|
|
protected IdentityUserCreateOrUpdateDtoBase() : base(false) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -23,12 +23,10 @@ namespace Volo.Abp.Identity |
|
|
|
|
|
|
|
public bool PhoneNumberConfirmed { get; set; } |
|
|
|
|
|
|
|
public bool TwoFactorEnabled { get; set; } |
|
|
|
|
|
|
|
public bool LockoutEnabled { get; set; } |
|
|
|
|
|
|
|
public DateTimeOffset? LockoutEnd { get; set; } |
|
|
|
|
|
|
|
public string ConcurrencyStamp { get; set; } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -162,7 +162,6 @@ namespace Volo.Abp.Identity |
|
|
|
(await UserManager.SetPhoneNumberAsync(user, input.PhoneNumber)).CheckErrors(); |
|
|
|
} |
|
|
|
|
|
|
|
(await UserManager.SetTwoFactorEnabledAsync(user, input.TwoFactorEnabled)).CheckErrors(); |
|
|
|
(await UserManager.SetLockoutEnabledAsync(user, input.LockoutEnabled)).CheckErrors(); |
|
|
|
|
|
|
|
user.Name = input.Name; |
|
|
|
|
|
|
|
@ -120,9 +120,6 @@ |
|
|
|
<Field> |
|
|
|
<Check TValue="bool" @bind-checked="@NewEntity.LockoutEnabled">@L["DisplayName:LockoutEnabled"]</Check> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<Check TValue="bool" @bind-checked="@NewEntity.TwoFactorEnabled">@L["DisplayName:TwoFactorEnabled"]</Check> |
|
|
|
</Field> |
|
|
|
</TabPanel> |
|
|
|
<TabPanel Name="Roles"> |
|
|
|
@if (NewUserRoles != null) |
|
|
|
@ -191,9 +188,6 @@ |
|
|
|
<Field> |
|
|
|
<Check TValue="bool" @bind-checked="EditingEntity.LockoutEnabled">@L["DisplayName:LockoutEnabled"]</Check> |
|
|
|
</Field> |
|
|
|
<Field> |
|
|
|
<Check TValue="bool" @bind-checked="EditingEntity.TwoFactorEnabled">@L["DisplayName:TwoFactorEnabled"]</Check> |
|
|
|
</Field> |
|
|
|
</TabPanel> |
|
|
|
<TabPanel Name="Roles"> |
|
|
|
@if (EditUserRoles != null) |
|
|
|
|
|
|
|
@ -26,8 +26,7 @@ |
|
|
|
<abp-input asp-for="UserInfo.Email" /> |
|
|
|
<abp-input asp-for="UserInfo.PhoneNumber" /> |
|
|
|
<abp-input asp-for="UserInfo.LockoutEnabled" /> |
|
|
|
<abp-input asp-for="UserInfo.TwoFactorEnabled" /> |
|
|
|
|
|
|
|
|
|
|
|
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<CreateModalModel.UserInfoViewModel>()) |
|
|
|
{ |
|
|
|
if (propertyInfo.Type.IsEnum) |
|
|
|
@ -56,4 +55,4 @@ |
|
|
|
</abp-modal-body> |
|
|
|
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer> |
|
|
|
</abp-modal> |
|
|
|
</form> |
|
|
|
</form> |
|
|
|
|
|
|
|
@ -79,8 +79,6 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Users |
|
|
|
[DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] |
|
|
|
public string PhoneNumber { get; set; } |
|
|
|
|
|
|
|
public bool TwoFactorEnabled { get; set; } = true; |
|
|
|
|
|
|
|
public bool LockoutEnabled { get; set; } = true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -28,8 +28,7 @@ |
|
|
|
<abp-input asp-for="UserInfo.Email" /> |
|
|
|
<abp-input asp-for="UserInfo.PhoneNumber" /> |
|
|
|
<abp-input asp-for="UserInfo.LockoutEnabled" /> |
|
|
|
<abp-input asp-for="UserInfo.TwoFactorEnabled" /> |
|
|
|
|
|
|
|
|
|
|
|
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<EditModalModel.UserInfoViewModel>()) |
|
|
|
{ |
|
|
|
if (propertyInfo.Type.IsEnum) |
|
|
|
@ -46,7 +45,7 @@ |
|
|
|
value="@propertyInfo.GetInputValueOrNull(Model.UserInfo.ExtraProperties[propertyInfo.Name])" /> |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
</abp-tab> |
|
|
|
<abp-tab title="@L["Roles"].Value"> |
|
|
|
@for (var i = 0; i < Model.Roles.Length; i++) |
|
|
|
@ -59,4 +58,4 @@ |
|
|
|
</abp-modal-body> |
|
|
|
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer> |
|
|
|
</abp-modal> |
|
|
|
</form> |
|
|
|
</form> |
|
|
|
|
|
|
|
@ -87,8 +87,6 @@ namespace Volo.Abp.Identity.Web.Pages.Identity.Users |
|
|
|
[DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxPhoneNumberLength))] |
|
|
|
public string PhoneNumber { get; set; } |
|
|
|
|
|
|
|
public bool TwoFactorEnabled { get; set; } |
|
|
|
|
|
|
|
public bool LockoutEnabled { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -98,7 +98,6 @@ namespace Volo.Abp.Identity |
|
|
|
{ |
|
|
|
UserName = johnNash.UserName, |
|
|
|
LockoutEnabled = true, |
|
|
|
TwoFactorEnabled = true, |
|
|
|
PhoneNumber = CreateRandomPhoneNumber(), |
|
|
|
Password = "123qwe4R*", |
|
|
|
Email = CreateRandomEmail(), |
|
|
|
@ -135,7 +134,7 @@ namespace Volo.Abp.Identity |
|
|
|
{ |
|
|
|
//Get user
|
|
|
|
var johnNash = await _userAppService.GetAsync(_testData.UserJohnId); |
|
|
|
|
|
|
|
|
|
|
|
//Act
|
|
|
|
|
|
|
|
var input = new IdentityUserUpdateDto |
|
|
|
@ -144,7 +143,6 @@ namespace Volo.Abp.Identity |
|
|
|
Surname = "Nash-updated", |
|
|
|
UserName = johnNash.UserName, |
|
|
|
LockoutEnabled = true, |
|
|
|
TwoFactorEnabled = true, |
|
|
|
PhoneNumber = CreateRandomPhoneNumber(), |
|
|
|
Email = CreateRandomEmail(), |
|
|
|
RoleNames = new[] { "admin", "moderator" }, |
|
|
|
|
|
|
|
@ -44,7 +44,6 @@ namespace Volo.Abp.Identity.AspNetCore |
|
|
|
user.Name.ShouldBe("Test Name"); |
|
|
|
user.Surname.ShouldBe("Test Surname"); |
|
|
|
user.EmailConfirmed.ShouldBeTrue(); |
|
|
|
user.TwoFactorEnabled.ShouldBeFalse(); |
|
|
|
user.PhoneNumber.ShouldBe("123"); |
|
|
|
user.PhoneNumberConfirmed.ShouldBeFalse(); |
|
|
|
user.IsExternal.ShouldBeTrue(); |
|
|
|
|