예제 #1
0
        public async Task <ActionResult <JwtAuthenticationResult> > RefreshToken([FromBody] JwtAuthenticationResult model)
        {
            _logger.LogDebug("Refreshing token for RefreshToken {Token}", model.RefreshToken);
            var authentication = await _jwtTokenService.RefreshAsync(model.AccessToken, model.RefreshToken);

            if (authentication.InvalidCredentials || authentication.AuthenticationRequired)
            {
                return(StatusCode((int)HttpStatusCode.Unauthorized));
            }

            return(Json(authentication));
        }