mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 05:04:27 +00:00
Fix admin redirect
This commit is contained in:
parent
3097dbebe9
commit
573a76c0c5
1 changed files with 4 additions and 1 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue