From: Marcelo Trylesinski Date: Tue, 17 May 2022 09:36:34 +0000 (+0200) Subject: Document `status_code` parameter on `requires` when using WebSockets (#1636) X-Git-Tag: 0.20.1~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=621abc747a6604825190b93467918a0ec6456a24;p=thirdparty%2Fstarlette.git Document `status_code` parameter on `requires` when using WebSockets (#1636) --- diff --git a/docs/authentication.md b/docs/authentication.md index d6cec3fb..513db5c8 100644 --- a/docs/authentication.md +++ b/docs/authentication.md @@ -115,6 +115,10 @@ async def dashboard(request): ... ``` +!!! note + The `status_code` parameter is not supported with WebSockets. The 403 (Forbidden) + status code will always be used for those. + Alternatively you might want to redirect unauthenticated users to a different page.