diff --git a/src/app/(dashboard)/settings/page.tsx b/src/app/(dashboard)/settings/page.tsx index 2e3cd79..73051d3 100644 --- a/src/app/(dashboard)/settings/page.tsx +++ b/src/app/(dashboard)/settings/page.tsx @@ -171,6 +171,8 @@ function QlikSettingsSection() { const [host, setHost] = useState(""); const [user, setUser] = useState(""); const [password, setPassword] = useState(""); + // Le mot de passe enregistré n'est jamais renvoyé : on sait seulement qu'il existe. + const [hasSavedPassword, setHasSavedPassword] = useState(false); const [showPwd, setShowPwd] = useState(false); const [saving, setSaving] = useState(false); const [testing, setTesting] = useState(false); @@ -181,7 +183,7 @@ function QlikSettingsSection() { if (!c) return; setHost(c.qlikHost ?? ""); setUser(c.qlikUser ?? ""); - setPassword(c.qlikPassword ?? ""); + setHasSavedPassword(c.hasQlikPassword); }); }, []); @@ -190,6 +192,10 @@ function QlikSettingsSection() { setStatus(null); const res = await saveQlikSettings(host.trim(), user.trim(), password); setSaving(false); + if (res.success && password) { + setHasSavedPassword(true); + setPassword(""); + } setStatus(res.success ? { type: "ok", msg: "Réglages Qlik enregistrés" } : { type: "err", msg: res.error || "Erreur" }); }; @@ -211,9 +217,9 @@ function QlikSettingsSection() { setUser(e.target.value)} className="apple-input font-mono" /> - +
- setPassword(e.target.value)} className="apple-input font-mono pr-10" /> -