Esempio n. 1
0
        // POST: api/Accounts/authenticate
        public async Task <IActionResult> Authenticate([FromBody] UserForAuthenticationDto userDto)
        {
            var tokenResponse = await businessLogic.AuthenticateUser(userDto, Request);

            if (tokenResponse.IsSuccessful)
            {
                return(Ok(tokenResponse.Result));
            }

            return(BadRequest(new { message = tokenResponse.ErrorMessage }));
        }