Fix admin redirect

main
Thomas Sileo 2022-12-15 22:27:14 +01:00
parent 3097dbebe9
commit 573a76c0c5
1 changed files with 4 additions and 1 deletions

View File

@ -1,4 +1,5 @@
from datetime import datetime from datetime import datetime
from urllib.parse import quote
import httpx import httpx
from fastapi import APIRouter from fastapi import APIRouter
@ -59,7 +60,9 @@ async def user_session_or_redirect(
_RedirectToLoginPage = HTTPException( _RedirectToLoginPage = HTTPException(
status_code=302, 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: if not session: