forked from forks/microblog.pub
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