Add redirection if not logged
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Michel Roux 2022-09-18 21:15:03 +00:00
parent bb842f7fd0
commit 1498587437

View File

@ -140,6 +140,8 @@ def login_required(fn):
async def wrapper(*args, **kwargs):
if session.get("oauth2_token"):
return await fn(*args, **kwargs)
session["redirect_url"] = request.path
return redirect(url_for(".login"))
return wrapper
@ -171,7 +173,7 @@ async def callback():
authorization_response=request.url,
)
token_updater(token)
return redirect(url_for(".guilds"))
return redirect(session.pop("redirect_url", url_for(".guilds")))
@app.route("/guilds")