FastAPI - Authentication and Security
Given this FastAPI code snippet, what will be the output if the JWT token is expired?
from fastapi import Depends, HTTPException
from fastapi.security import OAuth2PasswordBearer
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
async def verify_token(token: str = Depends(oauth2_scheme)):
if token == "expired":
raise HTTPException(status_code=401, detail="Token expired")
return "Valid token"
result = await verify_token("expired")
