Improve the stuffs

This commit is contained in:
thec0sm0s
2020-10-01 00:18:28 +05:30
parent 673c0a69d5
commit d9ceb518c9
6 changed files with 14 additions and 14 deletions

View File

@@ -65,25 +65,25 @@ in exchange for fetching user's details and display them on web page.
@app.route("/login/")
def login():
return discord.create_session()
async def login():
return await discord.create_session()
@app.route("/callback/")
def callback():
discord.callback()
async def callback():
await discord.callback()
return redirect(url_for(".me"))
@app.errorhandler(Unauthorized)
def redirect_unauthorized(e):
async def redirect_unauthorized(e):
return redirect(url_for("login"))
@app.route("/me/")
@requires_authorization
def me():
user = discord.fetch_user()
async def me():
user = await discord.fetch_user()
return f"""
<html>
<head>