Skip to content

Commit b1b1d3f

Browse files
committed
docs: Add custom HTTPBearer annotation
1 parent ee81706 commit b1b1d3f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

backend/common/security/jwt.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ class CustomHTTPBearer(HTTPBearer):
3232
"""
3333
自定义 HTTPBearer 认证类
3434
35-
重写 __call__ 方法,当认证失败时:
36-
- 如果原始异常是 403 状态码,则抛出 401 状态码的 TokenError
37-
- 其他异常保持原样抛出
35+
https://github.com/fastapi/fastapi/issues/10177
3836
"""
3937
async def __call__(self, request: Request) -> HTTPAuthorizationCredentials | None:
4038
try:

0 commit comments

Comments
 (0)