i have no errors in console window of course i did all the necessary changes in Register.cshtml and Register.js actually i working on the last version v.12.0
this object returned when execute the command "window.passwordComplexitySetting"
Object
MaxLength:25
MinLength:6
UseLowerCaseLetters:true
UseNumbers:true
UsePunctuations:false
UseUpperCaseLetters:false
__proto__:Object
by the way these are not the values saved in my database
Object
MaxLength:25
MinLength:8
UseLowerCaseLetters:true
UseNumbers:true
UsePunctuations:false
UseUpperCaseLetters:true
__proto__:Object
and its working just fine in reset password page and user's settings
Hello i noticed that password complexity setting not working in Register page although property
public PasswordComplexitySetting PasswordComplexitySetting { get; set; }
are defined in RegisterViewModel but still not working how can i fix it ?
Thank you
Hello i tried to find localization file of module zero AbpZero.xml that contains some messages translation like Identity.DuplicateName , Identity.DuplicateEmail etc i checked this link but i can't find this file in my project [https://github.com/aspnetboilerplate/module-zero/blob/dev/src/Abp.Zero/Zero/Localization/Source/AbpZero.xml#L11])
actually i tried also to add these lines in my localization sources but it didn't work
<text name="Identity.DuplicateName" value="UserName already used" />
<text name="Identity.DuplicateEmail" value="Email Address already used" />
Thank you now it's working just fine
i'm sorry if i bothering you with my questions actually i tried the following UserManager
private readonly IRepository<User, long> _userRepository;
public virtual async Task<User> FindByMobileAsync(string mobile)
{
return await _userRepository.FirstOrDefaultAsync(
user => user.Mobile == mobile
);
}
i got error because _userRepository is null what i missing here ?
then what shall i do also to use L Method in usermanager ? can you please provide me a piece of code to help in my situation ? thank you
Thank you for your reply i have a further questions and i appreciate your help
in UserManager i overrided CreateAsync Method then added CheckDuplicateMobileAsync Method
public override async Task<IdentityResult> CreateAsync(User user)
{
var result = await CheckDuplicateMobileAsync(user.Id, user.Mobile);
if (!result.Succeeded)
{
return result;
}
return await base.CreateAsync(user);
}
public virtual async Task<IdentityResult> CheckDuplicateMobileAsync(long? expectedUserId, string mobile)
{
var user = (await FindByMobileAsync(mobile)); ////////////////////// This line
if (user != null && user.Id != expectedUserId)
{
return AbpIdentityResult.Failed(string.Format(L("Identity.DuplicateMobile"), mobile)); /////////////// This line
}
return IdentityResult.Success;
}
in UserStore
public class UserStore : AbpUserStore<Role, User>
{
private readonly IRepository<User, long> _userRepository;
public UserStore(
IRepository<User, long> userRepository,
IRepository<UserLogin, long> userLoginRepository,
IRepository<UserRole, long> userRoleRepository,
IRepository<Role> roleRepository,
IRepository<UserPermissionSetting, long> userPermissionSettingRepository,
IUnitOfWorkManager unitOfWorkManager
)
: base(
userRepository,
userLoginRepository,
userRoleRepository,
roleRepository,
userPermissionSettingRepository,
unitOfWorkManager
)
{
_userRepository = userRepository;
}
// Umbrella
public virtual async Task<User> FindByMobileAsync(string mobile)
{
return await _userRepository.FirstOrDefaultAsync(
user => user.Mobile == mobile
);
}
}
1- FindByMobileAsync is not exists in current context ???? 2- CS0103 The name 'L' does not exist in the current context ???
what is wrong with my code ?
Hello i want to know the mechanism used to prevent duplication of username and email address in ABP , i noticed that no unique index was used for them so how does it work , how can i do the same for mobile field in the same way , i don't want to duplicate the same mobile number in the same tenant that's why i don't need to use unique index thank you
I fount the solution
[StringLength(50)]
public override string Name { get; set; }
[StringLength(50)]
public override string Surname { get; set; }
Thank you