first shot at proper login.
This commit is contained in:
parent
0c43e49bb4
commit
e09c257995
|
@ -148,10 +148,12 @@ async def login_redirect(req):
|
||||||
|
|
||||||
|
|
||||||
@api.route("/logout")
|
@api.route("/logout")
|
||||||
async def login(req):
|
async def logout(req):
|
||||||
session = req.ctx.session
|
session = req.ctx.session
|
||||||
if "user_id" in session:
|
if "user_id" in session:
|
||||||
del session["user_id"]
|
del session["user_id"]
|
||||||
|
|
||||||
next_url = req.ctx.get_single_arg("next", default=None) or "/"
|
auth_req = client.construct_EndSessionRequest(state=session["state"])
|
||||||
return redirect(next_url)
|
logout_url = auth_req.request(client.end_session_endpoint)
|
||||||
|
|
||||||
|
return redirect(logout_url+f"&redirect_uri={req.ctx.api_url}/logout")
|
||||||
|
|
Loading…
Reference in a new issue