public AuthAppService(IDomainNotificationProvider notificationProvider, IUserRepository userRepository, IEncrypterService encrypterService, IJwtHandler jwt) { _notificationProvider = notificationProvider; _userRepository = userRepository; _encrypterService = encrypterService; _jwt = jwt; }
public User CreatePassword(string password, IEncrypterService encrypter) { if (password.PasswordIsValid()) { HashPassword = encrypter.Encrypt(password, Salt); } return(this); }
public UserService(IUserRepository userRepository, IEncrypterService encrypterService, IJwtHandler jwtHandler, IMapper mapper, ILogger <UserService> logger, IMemoryCache cache, ICredentialValidator credentialValidator) { _userRepository = userRepository; _encrypterService = encrypterService; _jwtHandler = jwtHandler; _mapper = mapper; _logger = logger; _cache = cache; _credentialValidator = credentialValidator; }
public User ChangePassword(string newPassword, string oldPassword, IEncrypterService encrypter) { var hashOldPassword = encrypter.Encrypt(oldPassword, Salt); if (HashPassword == hashOldPassword && !encrypter.Compare(newPassword, Salt, HashPassword)) { if (newPassword.PasswordIsValid()) { GenerateSalt(); HashPassword = encrypter.Encrypt(newPassword, Salt); } } return(this); }
public UserAppService(IUserRepository repository, IMapper mapper, IDomainNotificationProvider notificationProvider, IEncrypterService encrypterService) : base(repository, mapper, notificationProvider) { _userRepository = repository; _notificationProvider = notificationProvider; _encrypterService = encrypterService; }