1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-03 04:25:24 +02:00

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 234 additions and 120 deletions

View file

@ -36,7 +36,7 @@ def test_init_superuser(api_client: TestClient, admin_user: TestUser):
assert admin_data["groupId"] == admin_user.group_id
assert admin_data["fullName"] == "Change Me"
assert admin_data["email"] == settings.DEFAULT_EMAIL
assert admin_data["email"] == settings._DEFAULT_EMAIL
def test_create_user(api_client: TestClient, admin_token):
@ -95,7 +95,7 @@ def test_update_other_user_as_not_admin(api_client: TestClient, unique_user: Tes
update_data = {
"id": unique_user.user_id,
"fullName": "Updated Name",
"email": settings.DEFAULT_EMAIL,
"email": settings._DEFAULT_EMAIL,
"group": "Home",
"admin": True,
}

View file

@ -14,7 +14,7 @@ from tests.utils.fixture_schemas import TestUser
def test_failed_login(api_client: TestClient):
settings = get_app_settings()
form_data = {"username": settings.DEFAULT_EMAIL, "password": "WRONG_PASSWORD"}
form_data = {"username": settings._DEFAULT_EMAIL, "password": "WRONG_PASSWORD"}
response = api_client.post(api_routes.auth_token, data=form_data)
assert response.status_code == 401
@ -23,7 +23,7 @@ def test_failed_login(api_client: TestClient):
def test_superuser_login(api_client: TestClient, admin_token):
settings = get_app_settings()
form_data = {"username": settings.DEFAULT_EMAIL, "password": settings.DEFAULT_PASSWORD}
form_data = {"username": settings._DEFAULT_EMAIL, "password": settings._DEFAULT_PASSWORD}
response = api_client.post(api_routes.auth_token, data=form_data)
assert response.status_code == 200