From 7fe86c4b7390f8237d676dcb5ca89900d058c5f9 Mon Sep 17 00:00:00 2001 From: Sulthan Nauval Abdillah Date: Mon, 10 Aug 2026 05:36:43 +0000 Subject: [PATCH] fix(providers): clear the base-URL field when the gateway stops returning one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two problems in the same form, both of which kept an API key on screen. The effect that mirrors `GET /secrets` into the base-URL field was guarded on truthiness: if (secrets.data?.api_url) setUrl(secrets.data.api_url); so it only ever filled the field and never emptied it. A value the gateway stopped returning stayed rendered until a page reload. That is exactly what happens the moment the gateway starts withholding an `api_url` that holds an API key: the server returns null, the effect re-runs because the dependency changed, the guard skips the write, and the key remains visible in the console. Verified against a live gateway, with the panel's own Refresh button and no page reload. Before: the field still showed the value the server had already stopped returning. After: it clears. Same sequence, same server, same browser. Both inputs were also placeholder-only. They sit next to each other, one takes a URL and one takes a credential, and a placeholder disappears the moment either is focused — so the field that has just been cleared is also the one whose purpose is least visible while typing into it. Pasting a key into the base-URL field is what put a credential into config.toml in plaintext in the first place. Give both a real `