Ejemplo n.º 1
0
        public TokenEntity Login([FromBody] LoginRequest loginRequest)
        {
            var token = _tokenService.AuthenticateUser(loginRequest.Username, loginRequest.Password);

            if (token == null)
            {
                throw new HttpResponseException(HttpStatusCode.Unauthorized);
            }
            return(token);
        }