mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-02 19:44:28 +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 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:
|
||||
|
|
Loading…
Reference in a new issue