コード例 #1
0
 public IActionResult BroadcasterCode(
     [FromServices] API.Twitch.IBroadcasterTokenValidator broadcasterTokenValidator,
     [FromQuery(Name = "code")] string code,
     [FromQuery(Name = "state")] string state)
 {
     broadcasterTokenValidator.SetCode(code, state);
     return(Ok());
 }
コード例 #2
0
        public IActionResult BroadcasterCode(
            [FromServices] API.Twitch.IBroadcasterTokenValidator broadcasterTokenValidator,
            [FromQuery(Name = "code")] string code,
            [FromQuery(Name = "state")] string state)
        {
            if (string.IsNullOrEmpty(code) || string.IsNullOrEmpty(state))
            {
                return(BadRequest());
            }

            broadcasterTokenValidator.SetCode(code, state);
            return(Ok());
        }