🔥 Remove manual type annotations in JWT tutorial to avoid typing expectations (JWT doesn't provide more types) (#13378)

This commit is contained in:
Sebastián Ramírez
2025-02-15 17:28:09 +01:00
committed by GitHub
parent 2e788bbbdc
commit 08b817a842
8 changed files with 10 additions and 10 deletions

View File

@@ -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)