예제 #1
0
        public async Task <IActionResult> Refresh([FromBody] UserRefreshTokenReqObj request)
        {
            var authResponse = await _identityService.RefreshTokenAsync(request.RefreshToken, request.Token);

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

            return(Ok(new AuthSuccessResponse
            {
                Token = authResponse.Token,
                RefreshToken = authResponse.RefreshToken
            }));
        }
예제 #2
0
        public async Task <IActionResult> Refresh([FromBody] UserRefreshTokenReqObj request)
        {
            var authResponse = await _identityService.RefreshTokenAsync(request.RefreshToken, request.Token);

            //if (!authResponse.Success)
            //{
            //    return BadRequest(new AuthFailedResponse
            //    {
            //        Status = authResponse.Status,
            //    });
            //}

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