oauth initial support
This commit is contained in:
9
main.py
9
main.py
@@ -5,8 +5,10 @@ from ariadne.asgi import GraphQL
|
||||
from starlette.applications import Starlette
|
||||
from starlette.middleware import Middleware
|
||||
from starlette.middleware.authentication import AuthenticationMiddleware
|
||||
from starlette.routing import Route
|
||||
|
||||
from auth.authenticate import JWTAuthenticate
|
||||
from auth.oauth import oauth_login, oauth_authorize
|
||||
from redis import redis
|
||||
from resolvers.base import resolvers
|
||||
|
||||
@@ -22,7 +24,12 @@ async def start_up():
|
||||
|
||||
async def shutdown():
|
||||
await redis.disconnect()
|
||||
|
||||
routes = [
|
||||
Route("/oauth", endpoint=oauth_login),
|
||||
Route("/authorize", endpoint=oauth_authorize)
|
||||
]
|
||||
|
||||
|
||||
app = Starlette(debug=True, on_startup=[start_up], on_shutdown=[shutdown], middleware=middleware)
|
||||
app = Starlette(debug=True, on_startup=[start_up], on_shutdown=[shutdown], middleware=middleware, routes=routes)
|
||||
app.mount("/", GraphQL(schema, debug=True))
|
||||
|
Reference in New Issue
Block a user