mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-21 21:15:13 +00:00
Fix the superuser verify missing auth (#854)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user