Example #1
0
        private async Task <UserReadDTO> AuthenticateUser(UserLoginDTO userLoginDTO)
        {
            UserReadDTO userReadDTO = null;
            var         userFromDB  = await _repository.GetUserByEmail(userLoginDTO.email);

            if (userFromDB != null && BCrypt.Net.BCrypt.Verify(userLoginDTO.password, userFromDB.password))
            {
                userReadDTO = _mapper.Map <UserReadDTO>(userFromDB);
            }

            return(userReadDTO);
        }