コード例 #1
0
        public async Task <TokenResponseResult> ValidateToken([FromQuery][Required] string token)
        {
            try
            {
                var response = new TokenResponseResult();

                if (_signInManager.ValidateToken(token))
                {
                    response.Code        = 200;
                    response.AccessToken = token;

                    return(response);
                }

                response.Code    = 401;
                response.Message = "Token is invalid.";
                return(response);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "SignInController.refreshtoken");
                return(new TokenResponseResult()
                {
                    Code = (int)System.Net.HttpStatusCode.ExpectationFailed,
                    Message = ex.Message,
                });
            }
        }