Add an allow_unauthorized
option that does not bypass the middleware, but also does not raise NotAuthorized
if auth fails.
Route that returns the current authenticated user or None:
@get("/user", allow_unauthorized=True)
async def get_user(request: Request) -> dict[str, User | None]:
return {"user": request.user}
No response
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too