mirror of
https://github.com/yawaflua/Flask-Discord.git
synced 2025-12-10 12:29:30 +02:00
Bug fix
This commit is contained in:
@@ -11,4 +11,4 @@ __all__ = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
__version__ = "0.1.02"
|
__version__ = "0.1.03"
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class DiscordOAuth2HttpClient(abc.ABC):
|
|||||||
"""
|
"""
|
||||||
return OAuth2Session(
|
return OAuth2Session(
|
||||||
client_id=self.client_id,
|
client_id=self.client_id,
|
||||||
token=token or session.get("discord_oauth2_token"),
|
token=token or session.get("DISCORD_OAUTH2_TOKEN"),
|
||||||
state=state,
|
state=state,
|
||||||
scope=scope,
|
scope=scope,
|
||||||
redirect_uri=self.redirect_uri,
|
redirect_uri=self.redirect_uri,
|
||||||
@@ -103,7 +103,7 @@ class DiscordOAuth2HttpClient(abc.ABC):
|
|||||||
return response.json()
|
return response.json()
|
||||||
|
|
||||||
def get_json(self):
|
def get_json(self):
|
||||||
discord_session = self._make_session(token=session.get("discord_oauth2_token"))
|
discord_session = self._make_session(token=session.get("DISCORD_OAUTH2_TOKEN"))
|
||||||
user = discord_session.get(configs.API_BASE_URL + '/users/@me').json()
|
user = discord_session.get(configs.API_BASE_URL + '/users/@me').json()
|
||||||
guilds = discord_session.get(configs.API_BASE_URL + '/users/@me/guilds').json()
|
guilds = discord_session.get(configs.API_BASE_URL + '/users/@me/guilds').json()
|
||||||
connections = discord_session.get(configs.API_BASE_URL + '/users/@me/connections').json()
|
connections = discord_session.get(configs.API_BASE_URL + '/users/@me/connections').json()
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class DiscordOAuth2Session(_http.DiscordOAuth2HttpClient):
|
|||||||
"""
|
"""
|
||||||
if request.values.get("error"):
|
if request.values.get("error"):
|
||||||
return request.values["error"]
|
return request.values["error"]
|
||||||
discord = self._make_session(state=session.get("discord_oauth2_state"))
|
discord = self._make_session(state=session.get("DISCORD_OAUTH2_STATE"))
|
||||||
token = discord.fetch_token(
|
token = discord.fetch_token(
|
||||||
configs.TOKEN_URL,
|
configs.TOKEN_URL,
|
||||||
client_secret=self.client_secret,
|
client_secret=self.client_secret,
|
||||||
|
|||||||
Reference in New Issue
Block a user