示例#1
0
        public void SetPassword(string password, IEncryter encryter)
        {
            if (string.IsNullOrWhiteSpace(password))
            {
                throw new ActioException("empty_password", $"Password can not be empty");
            }

            Salt     = encryter.GetSalt(password);
            Password = encryter.GetHash(password, Salt);
        }
 public UserService(IUserRepository userRepository, IEncryter encryter, IJwtHandler jwtHandler)
 {
     this.userRepository = userRepository;
     this.encryter       = encryter;
     this.jwtHandler     = jwtHandler;
 }
示例#3
0
 public bool ValidatePassword(string password, IEncryter encryter)
 {
     return(this.Password.Equals(encryter.GetHash(password, Salt)));
 }