mirror of
https://github.com/yawaflua/Flask-Discord.git
synced 2025-12-10 04:19:31 +02:00
Don't use bot token
This commit is contained in:
@@ -33,18 +33,10 @@ class DiscordOAuth2HttpClient(abc.ABC):
|
|||||||
self.client_id = app.config["DISCORD_CLIENT_ID"]
|
self.client_id = app.config["DISCORD_CLIENT_ID"]
|
||||||
self.client_secret = app.config["DISCORD_CLIENT_SECRET"]
|
self.client_secret = app.config["DISCORD_CLIENT_SECRET"]
|
||||||
self.redirect_uri = app.config["DISCORD_REDIRECT_URI"]
|
self.redirect_uri = app.config["DISCORD_REDIRECT_URI"]
|
||||||
self.bot_token = app.config.get("DISCORD_BOT_TOKEN", str())
|
|
||||||
if "http://" in self.redirect_uri:
|
if "http://" in self.redirect_uri:
|
||||||
os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = "true"
|
os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = "true"
|
||||||
app.discord = self
|
app.discord = self
|
||||||
|
|
||||||
@property
|
|
||||||
def bot_authorization_header(self):
|
|
||||||
return {
|
|
||||||
"Authorization": f"Bot {self.bot_token}",
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
}
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _token_updater(token):
|
def _token_updater(token):
|
||||||
session["DISCORD_OAUTH2_TOKEN"] = token
|
session["DISCORD_OAUTH2_TOKEN"] = token
|
||||||
|
|||||||
Reference in New Issue
Block a user