Add enva to disable auth
This commit is contained in:
parent
b6f41f4d0a
commit
7307abf7d8
|
@ -1,8 +1,11 @@
|
|||
from fastapi import FastAPI, Depends
|
||||
from app import auth, user, server
|
||||
|
||||
from os import getenv
|
||||
app = FastAPI()
|
||||
|
||||
dependencies = list()
|
||||
if not getenv('DISABLE_AUTH'):
|
||||
dependencies.append(Depends(auth.authorise))
|
||||
app.include_router(auth.router)
|
||||
app.include_router(user.router)
|
||||
app.include_router(server.router, dependencies=[Depends(auth.authorise)])
|
||||
app.include_router(server.router, dependencies=dependencies)
|
||||
|
|
Loading…
Reference in New Issue