Fix admin redirect

This commit is contained in:
Thomas Sileo 2022-12-15 22:27:14 +01:00
parent 3097dbebe9
commit 573a76c0c5

View file

@ -1,4 +1,5 @@
from datetime import datetime
from urllib.parse import quote
import httpx
from fastapi import APIRouter
@ -59,7 +60,9 @@ async def user_session_or_redirect(
_RedirectToLoginPage = HTTPException(
status_code=302,
headers={"Location": request.url_for("login") + f"?redirect={redirect_url}"},
headers={
"Location": request.url_for("login") + f"?redirect={quote(redirect_url)}"
},
)
if not session: