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