Minor changes

This commit is contained in:
thecosmos
2019-05-06 22:53:03 +05:30
parent 5f0a16d1b5
commit 1a9a6d84f0
2 changed files with 9 additions and 2 deletions

View File

@@ -34,7 +34,7 @@ class DiscordOAuth2Session(object):
token_updater=self.__token_updater) token_updater=self.__token_updater)
def make_session(self): def make_session(self):
scope = request.args.get("scope", configs.DEFAULT_SCOPES).split() scope = request.args.get("scope", str()).split() or configs.DEFAULT_SCOPES
discord_session = self.__make_session(scope=scope) discord_session = self.__make_session(scope=scope)
authorization_url, state = discord_session.authorization_url(configs.AUTHORIZATION_BASE_URL) authorization_url, state = discord_session.authorization_url(configs.AUTHORIZATION_BASE_URL)
session["oauth2_state"] = state session["oauth2_state"] = state

View File

@@ -4,4 +4,11 @@ AUTHORIZATION_BASE_URL = API_BASE_URL + "/oauth2/authorize"
TOKEN_URL = API_BASE_URL + "/oauth2/token" TOKEN_URL = API_BASE_URL + "/oauth2/token"
DEFAULT_SCOPES = "identify email connections guilds guilds.join" ALL_SCOPES = [
"bot", "connections", "email", "identify", "guilds", "guilds.join",
"gdm.join", "messages.read", "rpc", "rpc.api", "rpc.notifications.read", "webhook.incoming",
]
DEFAULT_SCOPES = [
"bot", "identify", "email", "guilds", "guilds.join"
]