mirror of
https://github.com/fastapi/fastapi.git
synced 2026-03-28 11:45:33 -04:00
🔥 Remove manual type annotations in JWT tutorial to avoid typing expectations (JWT doesn't provide more types) (#13378)
This commit is contained in:
committed by
GitHub
parent
2e788bbbdc
commit
08b817a842
@@ -95,7 +95,7 @@ async def get_current_user(token: str = Depends(oauth2_scheme)):
|
||||
)
|
||||
try:
|
||||
payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
|
||||
username: str = payload.get("sub")
|
||||
username = payload.get("sub")
|
||||
if username is None:
|
||||
raise credentials_exception
|
||||
token_data = TokenData(username=username)
|
||||
|
||||
Reference in New Issue
Block a user