Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/source/jwt/examples/example.py
Original file line number Diff line number Diff line change
@@ -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(
Expand Down Expand Up @@ -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
Expand Down