public UserService(IUserRepository userRepository, IEncripter encripter,
                    IJwtHandler jwtHandler)
 {
     _userRepository = userRepository;
     _encripter      = encripter;
     _jwtHandler     = jwtHandler;
 }
Ejemplo n.º 2
0
        public void SetPassword(string password, IEncripter encriptor)
        {
            if (string.IsNullOrEmpty(password))
            {
                throw new ActioException("Empty user password",
                                         $"User password can not be empty");
            }

            Salt     = encriptor.GetSalt();
            password = encriptor.GetHash(password, Salt);
        }
Ejemplo n.º 3
0
 public bool ValidatePassword(string password, IEncripter encriptor)
 => password.Equals(encriptor.GetHash(password, Salt));