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):
|
async def wrapper(*args, **kwargs):
|
||||||
if session.get("oauth2_token"):
|
if session.get("oauth2_token"):
|
||||||
return await fn(*args, **kwargs)
|
return await fn(*args, **kwargs)
|
||||||
|
|
||||||
|
session["redirect_url"] = request.path
|
||||||
return redirect(url_for(".login"))
|
return redirect(url_for(".login"))
|
||||||
|
|
||||||
return wrapper
|
return wrapper
|
||||||
@ -171,7 +173,7 @@ async def callback():
|
|||||||
authorization_response=request.url,
|
authorization_response=request.url,
|
||||||
)
|
)
|
||||||
token_updater(token)
|
token_updater(token)
|
||||||
return redirect(url_for(".guilds"))
|
return redirect(session.pop("redirect_url", url_for(".guilds")))
|
||||||
|
|
||||||
|
|
||||||
@app.route("/guilds")
|
@app.route("/guilds")
|
||||||
|
Loading…
Reference in New Issue
Block a user