From 7307abf7d8601360e1ab90b9cf5b0326f3b67edc Mon Sep 17 00:00:00 2001 From: Jimmy Date: Thu, 13 Jan 2022 03:11:59 +0000 Subject: [PATCH] Add enva to disable auth --- app/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 9f209ab..0959f80 100755 --- a/app/main.py +++ b/app/main.py @@ -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)