Exemple #1
0
        public UserDto RegisterNewUser(RegistrationRequest registrationRequest, out RegistrationStatus registrationStatus)
        {
            registrationStatus = ValidateRegistration(registrationRequest);

            if (registrationStatus != RegistrationStatus.SUCCESS)
            {
                return(null);
            }

            HashedPasswordData hashedPassword = PasswordHashComputer.CreateHashedPassword(registrationRequest.Password);
            User user = CreateUser(registrationRequest, hashedPassword);

            return(Mapper.Map <UserDto>(user));
        }
Exemple #2
0
 private bool VerifyUserPassword(string loginPassword, User user)
 {
     return(PasswordHashComputer.IsPasswordEquals(loginPassword, user.HashedPassword, user.PasswordSalt));
 }