public IActionResult BotCode(
     [FromServices] API.Twitch.IBotTokenValidator botTokenValidator,
     [FromQuery(Name = "code")] string code,
     [FromQuery(Name = "state")] string state)
 {
     botTokenValidator.SetCode(code, state);
     return(Ok());
 }
Ejemplo n.º 2
0
        public IActionResult BotCode(
            [FromServices] API.Twitch.IBotTokenValidator botTokenValidator,
            [FromQuery(Name = "code")] string code,
            [FromQuery(Name = "state")] string state)
        {
            if (string.IsNullOrEmpty(code) || string.IsNullOrEmpty(state))
            {
                return(BadRequest());
            }

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