Exemple #1
0
        public async Task <Writter.API.Dto.User> AutenticateUser(Writter.API.Dto.WritterLoginRequest user)
        {
            try
            {
                var newUser = _mapper.Map <Writter.Domain.Dto.WritterLoginRequest>(user);

                var response = _mapper.Map <Writter.API.Dto.User>(await _service.AutenticateUser(newUser));

                return(response);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Exemple #2
0
        /// <summary>
        /// Method that validates a user's username and password
        /// </summary>
        public async Task <Dto.User> AutenticateUser(Gateway.API.Dto.UserLoginRequest user)
        {
            try
            {
                var newUser = _mapper.Map <Gateway.Domain.Dto.UserLoginRequest>(user);

                Gateway.Domain.Dto.User response = await _writterService.AutenticateUser(newUser);

                var response2 = _mapper.Map <Gateway.API.Dto.User>(response);

                return(response2);
            }
            catch (Exception ex)
            {
                log.Error(new Exception(), ex.Message);
                throw ex;
            }
        }