link
JSON Web Token auth
JWT token creation
from jose import JWTError, jwt SECRET_KEY = "secret" ALGORITHM = "HS256" def create_access_token(data: dict): to_encode = data.copy() return jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)