feat: auto detect first login (#2722)

* 'hide' default email and password env variables

* first login API endpoint

* run code-generators

* frontend indicators for default username and pw

* remove old env variables from docs

* fix env set variable

* remove password from tests
This commit is contained in:
Hayden
2023-11-15 09:24:24 -06:00
committed by GitHub
parent 71f95ca3c6
commit bc575ec5ae
22 changed files with 234 additions and 120 deletions

View File

@@ -13,7 +13,7 @@ def dev_users() -> list[dict]:
"full_name": "Jason",
"username": "jason",
"email": "jason@example.com",
"password": hash_password(settings.DEFAULT_PASSWORD),
"password": hash_password(settings._DEFAULT_PASSWORD),
"group": settings.DEFAULT_GROUP,
"admin": False,
},
@@ -21,7 +21,7 @@ def dev_users() -> list[dict]:
"full_name": "Bob",
"username": "bob",
"email": "bob@example.com",
"password": hash_password(settings.DEFAULT_PASSWORD),
"password": hash_password(settings._DEFAULT_PASSWORD),
"group": settings.DEFAULT_GROUP,
"admin": False,
},
@@ -29,7 +29,7 @@ def dev_users() -> list[dict]:
"full_name": "Sarah",
"username": "sarah",
"email": "sarah@example.com",
"password": hash_password(settings.DEFAULT_PASSWORD),
"password": hash_password(settings._DEFAULT_PASSWORD),
"group": settings.DEFAULT_GROUP,
"admin": False,
},
@@ -37,7 +37,7 @@ def dev_users() -> list[dict]:
"full_name": "Sammy",
"username": "sammy",
"email": "sammy@example.com",
"password": hash_password(settings.DEFAULT_PASSWORD),
"password": hash_password(settings._DEFAULT_PASSWORD),
"group": settings.DEFAULT_GROUP,
"admin": False,
},
@@ -48,8 +48,8 @@ def default_user_init(db: AllRepositories):
default_user = {
"full_name": "Change Me",
"username": "admin",
"email": settings.DEFAULT_EMAIL,
"password": hash_password(settings.DEFAULT_PASSWORD),
"email": settings._DEFAULT_EMAIL,
"password": hash_password(settings._DEFAULT_PASSWORD),
"group": settings.DEFAULT_GROUP,
"admin": True,
}