mirror of
https://github.com/yawaflua/Flask-Discord.git
synced 2025-12-10 04:19:31 +02:00
Minor changes
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user