changecase
This commit is contained in:
parent
cbc0a83d99
commit
88dc74414e
|
|
@ -12,6 +12,7 @@ python-multipart = "^0.0.5"
|
|||
uvicorn = "^0.17.6"
|
||||
loguru = "^0.6.0"
|
||||
alembic = "^1.7.7"
|
||||
pyyaml = "^6.0"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
|
||||
|
|
|
|||
|
|
@ -47,9 +47,9 @@ def parse_token(token: str = Depends(oauth_scame)):
|
|||
|
||||
try:
|
||||
jwt_data = jwt.decode(token, settings.ACCESS.SECRET_KEY, algorithms=settings.ACCESS.ALGORITHM)
|
||||
id = jwt_data.get("id")
|
||||
if id is None or id == "":
|
||||
user_id = jwt_data.get("id")
|
||||
if user_id is None or user_id == "":
|
||||
raise token_exception
|
||||
except JWTError:
|
||||
raise token_exception
|
||||
return id
|
||||
return user_id
|
||||
|
|
|
|||
Loading…
Reference in New Issue