浏览代码

Pass the instance we're using.

Tim Farrell 1 年之前
父节点
当前提交
e15dbdc46a
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      backend/utils/utils.py

+ 2 - 2
backend/utils/utils.py

@@ -21,7 +21,7 @@ ALGORITHM = "HS256"
 # Auth Utils
 ##############
 
-bearer_scheme = HTTPBearer()
+bearer_security = HTTPBearer()
 pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
 
 
@@ -58,7 +58,7 @@ def extract_token_from_auth_header(auth_header: str):
     return auth_header[len("Bearer ") :]
 
 
-def get_current_user(auth_token: HTTPAuthorizationCredentials = Depends(HTTPBearer())):
+def get_current_user(auth_token: HTTPAuthorizationCredentials = Depends(bearer_security)):
     data = decode_token(auth_token.credentials)
     if data != None and "id" in data:
         user = Users.get_user_by_id(data["id"])