We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bfab454 + 579cad2 commit 5b9a394Copy full SHA for 5b9a394
app/oauth2.py
@@ -27,12 +27,13 @@ def create_access_token(data: dict):
27
def verify_access_token(token: str, credentials_exception):
28
29
try:
30
-
+ # print(SECRET_KEY, credentials_exception)
31
payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
32
- id: str = payload.get("user_id")
33
- if id is None:
+ user_id: str = payload.get("user_id")
+ if user_id is None:
34
raise credentials_exception
35
- token_data = schemas.TokenData(id=id)
+ user_id = str(user_id)
36
+ token_data = schemas.TokenData(id=user_id)
37
except JWTError:
38
39
0 commit comments