Ejemplo n.º 1
0
        public async Task <IActionResult> Login([FromBody] UserLoginRequest request)
        {
            var authResponse = await _identityService.LoginAsync(request.Email, request.Password);

            if (!authResponse.Success)
            {
                return(BadRequest(new AuthFailedResponse
                {
                    Errors = authResponse.Errors
                }));
            }

            return(Ok(new AuthSuccessResponse
            {
                Token = authResponse.Token,
                RefreshToken = authResponse.RefreshToken
            }));
        }