Beispiel #1
0
 public AuthAppService(IDomainNotificationProvider notificationProvider, IUserRepository userRepository, IEncrypterService encrypterService, IJwtHandler jwt)
 {
     _notificationProvider = notificationProvider;
     _userRepository       = userRepository;
     _encrypterService     = encrypterService;
     _jwt = jwt;
 }
Beispiel #2
0
        public User CreatePassword(string password, IEncrypterService encrypter)
        {
            if (password.PasswordIsValid())
            {
                HashPassword = encrypter.Encrypt(password, Salt);
            }

            return(this);
        }
Beispiel #3
0
 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;
 }
Beispiel #4
0
        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;
 }