diff --git a/docs/source/jwt/examples/example.py b/docs/source/jwt/examples/example.py index 4f6377c3..86621d96 100644 --- a/docs/source/jwt/examples/example.py +++ b/docs/source/jwt/examples/example.py @@ -1,14 +1,17 @@ from datetime import timedelta from fastapi import FastAPI, Request -from home.tables import Movie # An example Table from piccolo_admin.endpoints import create_admin from piccolo_api.crud.endpoints import PiccoloCRUD from piccolo_api.fastapi.endpoints import FastAPIKwargs, FastAPIWrapper from piccolo_api.jwt_auth.endpoints import jwt_login from piccolo_api.jwt_auth.middleware import JWTBlacklist, JWTMiddleware +from piccolo.apps.user.tables import BaseUser from starlette.routing import Mount, Route +from home.tables import Movie # An example Table + + public_app = FastAPI( routes=[ Mount( @@ -54,6 +57,7 @@ async def in_blacklist(self, token: str) -> bool: public_app.mount("/private", protected_app) + # This is optional if you want to provide a logout endpoint # in your application. By adding a token to the token blacklist, # you are invalidating the token and need to login again to get