Пример #1
0
 def get_auth_url_twitch(cls, state):
     """Generate auth url for twitch."""
     # Generate a random string for the state parameter
     # Save it for use later to prevent xsrf attacks
     params = {"client_id": safe.get('twitch-client-id'),
               "response_type": "token",
               "state": state,
               "redirect_uri": TWITCH_REDIRECT_URI,
               "scope": "channel_editor"}
     url = "https://id.twitch.tv/oauth2/authorize?" + \
         urllib.parse.urlencode(params)
     return url
Пример #2
0
 def get_auth_url_nightbot(cls, state):
     """Generate auth url for nightbot."""
     # Generate a random string for the state parameter
     # Save it for use later to prevent xsrf attacks
     params = {"client_id": safe.get('nightbot-client-id'),
               "response_type": "token",
               "state": state,
               "redirect_uri": NIGHTBOT_REDIRECT_URI,
               "scope": "commands"}
     url = "https://api.nightbot.tv/oauth2/authorize?" + \
         urllib.parse.urlencode(params)
     return url