user env
This commit is contained in:
parent
f78745ef7b
commit
6d46456bca
@ -11,8 +11,10 @@ app.include_router(token.router)
|
|||||||
|
|
||||||
@app.on_event("startup")
|
@app.on_event("startup")
|
||||||
async def startup_event():
|
async def startup_event():
|
||||||
user_add.add(username="Peter93", password="toto", roles="Admin")
|
if len(os.environ["USERNAME_ADMIN"]) > 0 and len(os.environ["PASSWORD_ADMIN"]) > 0:
|
||||||
user_add.add(username="Robert80", password="titi", roles="User")
|
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("/")
|
@app.get("/")
|
||||||
async def root():
|
async def root():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user