Skip to content

Commit f319f6b

Browse files
authored
Update sample code to match imports and function usage (#15)
* Update sample code to match imports and function usage * @jtemporal Adds missing FastAPI imports - Depends, Request, Response
1 parent 8dd2d8c commit f319f6b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/auth0_fastapi/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ poetry install auth0-fastapi
4848
# main.py
4949
import os
5050
import uvicorn
51-
from fastapi import FastAPI
51+
from fastapi import FastAPI, Depends, Request, Response
5252
from starlette.middleware.sessions import SessionMiddleware
5353

5454
from auth0_fastapi.config import Auth0Config
5555
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
5757
from auth0_fastapi.errors import register_exception_handlers
5858

5959
app = FastAPI(title="Auth0-FastAPI Example")
@@ -78,7 +78,7 @@ app.state.config = config
7878
app.state.auth_client = auth_client
7979

8080
# 4) Conditionally register routes
81-
register_auth_routes((router, config))
81+
register_auth_routes(router, config)
8282

8383
# 5) Include the SDK’s default routes
8484
app.include_router(router)
@@ -127,7 +127,7 @@ To tweak these stores - to change cookie names or expiration dates - or to use a
127127
# main.py
128128
import os
129129
import uvicorn
130-
from fastapi import FastAPI
130+
from fastapi import FastAPI, Depends, Request, Response
131131
from starlette.middleware.sessions import SessionMiddleware
132132

133133
from auth0_fastapi.config import Auth0Config
@@ -157,7 +157,7 @@ app.state.config = config
157157
app.state.auth_client = auth_client
158158

159159
# 4) Conditionally register routes
160-
register_auth_routes((router, config))
160+
register_auth_routes(router, config)
161161

162162
# 5) Include the SDK’s default routes
163163
app.include_router(router)
@@ -283,4 +283,4 @@ Please do not report security vulnerabilities on the public GitHub issue tracker
283283
</p>
284284
<p align="center">
285285
This project is licensed under the MIT license. See the <a href="https://github.com/auth0/auth0-server-python/blob/main/packages/auth0_fastapi/LICENSE"> LICENSE</a> file for more info.
286-
</p>
286+
</p>

0 commit comments

Comments
 (0)