예제 #1
0
        public async Task <object> Login([FromBody] LoginDto user)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                var result = await _loginService.AutenticarUser(user);

                if (result == null)
                {
                    return(NotFound(result));
                }

                return(Ok(result));
            }
            catch (ArgumentException ex)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message));
            }
        }