Skip to content

Commit

Permalink
fix(frontend): change patch check for omitting 401 details, add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertRosca committed Sep 24, 2024
1 parent f4e96f3 commit 44494f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/zulip_write_only_proxy/routers/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def check_auth(request: Request):
status_code=401,
detail=(
"Unauthorized - no authentication provided"
if request.url.path != "/"
if request.url.path.rstrip("/") != request.scope.get("root_path", "")
else ""
),
)
Expand All @@ -54,6 +54,7 @@ async def check_auth(request: Request):


async def auth_redirect(request: Request, exc: AuthException):
logger.info("Redirecting to login", status_code=exc.status_code, detail=exc.detail)
return TEMPLATES.TemplateResponse(
"login.html",
{"request": request, "message": exc.detail},
Expand Down

0 comments on commit 44494f8

Please sign in to comment.