diff --git a/app/main.py b/app/main.py index 8297dde..1f3552f 100644 --- a/app/main.py +++ b/app/main.py @@ -11,8 +11,10 @@ app.include_router(token.router) @app.on_event("startup") async def startup_event(): - user_add.add(username="Peter93", password="toto", roles="Admin") - user_add.add(username="Robert80", password="titi", roles="User") + if len(os.environ["USERNAME_ADMIN"]) > 0 and len(os.environ["PASSWORD_ADMIN"]) > 0: + user_add.add(username=os.environ["USERNAME_ADMIN"], password=os.environ["PASSWORD_ADMIN"], roles="Admin") + if len(os.environ["USERNAME_TEST"]) > 0 and len(os.environ["PASSWORD_TEST"]) > 0: + user_add.add(username=os.environ["USERNAME_TEST"], password=os.environ["PASSWORD_TEST"], roles="User") @app.get("/") async def root():