Exemple #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;
 }
Exemple #3
0
 public bool ValidatePassword(string password, IEncryter encryter)
 {
     return(this.Password.Equals(encryter.GetHash(password, Salt)));
 }