You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/auth0_fastapi/README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,12 +48,12 @@ poetry install auth0-fastapi
48
48
# main.py
49
49
import os
50
50
import uvicorn
51
-
from fastapi import FastAPI
51
+
from fastapi import FastAPI, Depends, Request, Response
52
52
from starlette.middleware.sessions import SessionMiddleware
53
53
54
54
from auth0_fastapi.config import Auth0Config
55
55
from auth0_fastapi.auth.auth_client import AuthClient
56
-
from auth0_fastapi.server.routes import router
56
+
from auth0_fastapi.server.routes import router, register_auth_routes
57
57
from auth0_fastapi.errors import register_exception_handlers
58
58
59
59
app = FastAPI(title="Auth0-FastAPI Example")
@@ -78,7 +78,7 @@ app.state.config = config
78
78
app.state.auth_client = auth_client
79
79
80
80
# 4) Conditionally register routes
81
-
register_auth_routes((router, config))
81
+
register_auth_routes(router, config)
82
82
83
83
# 5) Include the SDK’s default routes
84
84
app.include_router(router)
@@ -127,7 +127,7 @@ To tweak these stores - to change cookie names or expiration dates - or to use a
127
127
# main.py
128
128
import os
129
129
import uvicorn
130
-
from fastapi import FastAPI
130
+
from fastapi import FastAPI, Depends, Request, Response
131
131
from starlette.middleware.sessions import SessionMiddleware
132
132
133
133
from auth0_fastapi.config import Auth0Config
@@ -157,7 +157,7 @@ app.state.config = config
157
157
app.state.auth_client = auth_client
158
158
159
159
# 4) Conditionally register routes
160
-
register_auth_routes((router, config))
160
+
register_auth_routes(router, config)
161
161
162
162
# 5) Include the SDK’s default routes
163
163
app.include_router(router)
@@ -283,4 +283,4 @@ Please do not report security vulnerabilities on the public GitHub issue tracker
283
283
</p>
284
284
<palign="center">
285
285
This project is licensed under the MIT license. See the <ahref="https://github.com/auth0/auth0-server-python/blob/main/packages/auth0_fastapi/LICENSE"> LICENSE</a> file for more info.
0 commit comments