diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs index 6450adfad9..508728eea1 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserManager.cs @@ -62,13 +62,13 @@ namespace Volo.Abp.Identity public virtual async Task CreateAsync(IdentityUser user, string password, bool validatePassword) { - var result = await CreateAsync(user); + var result = await UpdatePasswordHash(user, password, validatePassword); if (!result.Succeeded) { return result; } - return await UpdatePasswordHash(user, password, validatePassword); + return await CreateAsync(user); } public virtual async Task GetByIdAsync(Guid id) diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/PasswordOptionsExtensions.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/PasswordOptionsExtensions.cs deleted file mode 100644 index 793cc6349e..0000000000 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/PasswordOptionsExtensions.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using Microsoft.AspNetCore.Identity; - -namespace Volo.Abp.Identity -{ - public static class PasswordOptionsExtensions - { - public static IDisposable ClearRequirements(this PasswordOptions options) - { - var oldRequireDigit = options.RequireDigit; - var oldRequiredLength = options.RequiredLength; - var oldRequireLowercase = options.RequireLowercase; - var oldRequireUppercase = options.RequireUppercase; - var oldRequiredUniqueChars = options.RequiredUniqueChars; - var oldRequireNonAlphanumeric = options.RequireNonAlphanumeric; - - options.RequireDigit = false; - options.RequiredLength = 1; - options.RequireLowercase = false; - options.RequireUppercase = false; - options.RequiredUniqueChars = 1; - options.RequireNonAlphanumeric = false; - - return new DisposeAction(() => - { - options.RequireDigit = oldRequireDigit; - options.RequiredLength = oldRequiredLength; - options.RequireLowercase = oldRequireLowercase; - options.RequireUppercase = oldRequireUppercase; - options.RequiredUniqueChars = oldRequiredUniqueChars; - options.RequireNonAlphanumeric = oldRequireNonAlphanumeric; - }); - } - } -}