diff --git a/docs/screenshots/home.png b/docs/screenshots/home.png index 56646be..25fa8dc 100644 Binary files a/docs/screenshots/home.png and b/docs/screenshots/home.png differ diff --git a/router_dyndns/ddns.py b/router_dyndns/ddns.py index 28b378f..b747ac8 100644 --- a/router_dyndns/ddns.py +++ b/router_dyndns/ddns.py @@ -327,9 +327,8 @@ def make_app(settings: DdnsSettings | None = None) -> FastAPI: @app.post("/magic", response_class=HTMLResponse) async def magic_account(request: Request) -> str: - form = await _request_form(request, settings) - username = _first_form_value(form, "username") or None - account = await run_in_threadpool(service.create_managed_account, username) + await _request_form(request, settings) + account = await run_in_threadpool(service.create_managed_account, None) return _render_public_home(service, settings, account, None) @app.get("/m/{management_slug}", response_class=HTMLResponse) @@ -401,16 +400,15 @@ def make_app(settings: DdnsSettings | None = None) -> FastAPI: async def self_service_account(request: Request) -> str: form = await _request_form(request, settings) mode = _first_form_value(form, "mode") - username = _first_form_value(form, "username") or None if mode == "managed": - account = await run_in_threadpool(service.create_managed_account, username) + account = await run_in_threadpool(service.create_managed_account, None) else: claim_secret = _first_form_value(form, "claim_secret") account = await run_in_threadpool( service.create_custom_account, _first_form_value(form, "hostname"), claim_secret, - username, + None, ) return _render_public_home(service, settings, account, None) @@ -678,10 +676,7 @@ def _render_public_home(
- +

KarlDNS generates the hostname, secret update URL, and optional router compatibility credentials automatically.

@@ -775,10 +770,7 @@ def _custom_domain_flow(service: DdnsService, challenge: dict[str, str | None] | - +

Router compatibility credentials are generated automatically after creation.

diff --git a/tests/test_ddns.py b/tests/test_ddns.py index 5ee24e6..7454323 100644 --- a/tests/test_ddns.py +++ b/tests/test_ddns.py @@ -391,7 +391,7 @@ def test_magic_hostname_without_login_generates_update_and_management_links(tmp_ ) client = TestClient(app) - response = client.post("/magic", data={"username": "alice"}) + response = client.post("/magic") assert response.status_code == 200 assert "Update-URL:" in response.text @@ -558,7 +558,7 @@ def test_api_docs_include_versioned_ddns_api(tmp_path: Path) -> None: assert all(tag["name"] != "admin" for tag in schema["tags"]) -def test_public_home_hides_admin_link_and_explains_router_login(tmp_path: Path) -> None: +def test_public_home_hides_admin_link_and_uses_automatic_router_login(tmp_path: Path) -> None: app = make_app( DdnsSettings( database_path=tmp_path / "ddns.sqlite3", @@ -572,8 +572,9 @@ def test_public_home_hides_admin_link_and_explains_router_login(tmp_path: Path) assert response.status_code == 200 assert 'href="/admin"' not in response.text - assert "Router login name" in response.text - assert "FRITZ!Box Benutzername" in response.text + assert "Router login name" not in response.text + assert 'name="username"' not in response.text + assert "generates the hostname, secret update URL, and optional router compatibility credentials automatically" in response.text def test_application_pages_use_stricter_script_csp(tmp_path: Path) -> None: