From dd08775c8509e64618684656c33e9b42b36cdfe2 Mon Sep 17 00:00:00 2001 From: Wu Clan Date: Tue, 14 Oct 2025 17:55:54 +0800 Subject: [PATCH] Fix the superuser verify missing auth (#854) --- backend/common/security/jwt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/common/security/jwt.py b/backend/common/security/jwt.py index bdf0c815..96bb4e97 100644 --- a/backend/common/security/jwt.py +++ b/backend/common/security/jwt.py @@ -263,11 +263,12 @@ async def get_current_user(db: AsyncSession, pk: int) -> User: return user -def superuser_verify(request: Request) -> bool: +def superuser_verify(request: Request, _token: str = DependsJwtAuth) -> bool: """ 验证当前用户超级管理员权限 :param request: FastAPI 请求对象 + :param _token: JWT 令牌 :return: """ superuser = request.user.is_superuser