Style changes for logout

This commit is contained in:
decentral1se 2021-06-11 22:30:13 +02:00
parent 30edb39163
commit 1acc7705df
Signed by: decentral1se
GPG Key ID: 92DAD76BD9567B8A

View File

@ -2,11 +2,11 @@
from os import environ
import httpx
from authlib.integrations.starlette_client import OAuth, OAuthError
from fastapi import FastAPI, Request
from fastapi.responses import HTMLResponse, RedirectResponse
from fastapi.templating import Jinja2Templates
from httpx import get
from starlette.middleware.sessions import SessionMiddleware
APP_SECRET_KEY = environ.get("APP_SECRET_KEY")
@ -69,6 +69,6 @@ async def auth_keycloak(request: Request):
@app.route("/logout")
async def logout(request: Request):
httpx.get(f"{BASE_URL}/logout")
request.session.pop("user", None)
get(f"{BASE_URL}/logout")
return RedirectResponse(request.url_for("login"))