Auth restricted endpoint is picky about the trailing slash, use it consistently.
This commit is contained in:
+2
-2
@@ -269,7 +269,7 @@ async def verify(request, *, privileged=False):
|
||||
raise Unauthorized(
|
||||
f"Login required for {request.path}",
|
||||
"cookie",
|
||||
context={"auth": {"iframe": "/auth/restricted"}},
|
||||
context={"auth": {"iframe": "/auth/restricted/"}},
|
||||
quiet=True,
|
||||
)
|
||||
|
||||
@@ -278,7 +278,7 @@ async def verify(request, *, privileged=False):
|
||||
bp = Blueprint("auth", url_prefix="/auth")
|
||||
|
||||
|
||||
@bp.get("/restricted")
|
||||
@bp.get("/restricted/")
|
||||
async def login_page(request):
|
||||
"""Login page that works both standalone and in paskia iframe."""
|
||||
s = session.get(request)
|
||||
|
||||
@@ -115,7 +115,7 @@ const settingsMenu = (e: Event) => {
|
||||
// Show login option only in public mode (non-public modes trigger auth automatically)
|
||||
items.push({ label: '🔐 Login', onClick: async () => {
|
||||
try {
|
||||
await showAuthIframe('/auth/restricted#theme=light')
|
||||
await showAuthIframe('/auth/restricted/#theme=light')
|
||||
resumeWatching()
|
||||
} catch (e) {
|
||||
console.log('Login cancelled')
|
||||
|
||||
Reference in New Issue
Block a user