Add redirection if not logged
This commit is contained in:
parent
bb842f7fd0
commit
1498587437
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user