From 597017ebceeece579f3f8a972e39e5f36f33336e Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Thu, 14 Aug 2025 10:17:10 +0000 Subject: [PATCH] fix: improve export dialog for users without authentication - No longer shows 'Use your login password' option when no auth is configured - Defaults to passphrase-only mode for auth-less instances - Shows 'Encryption Passphrase' instead of confusing login password references - Always enforces 12-character minimum for auth-less users - Clearer messaging throughout for different auth states --- .../src/components/Settings/Settings.tsx | 109 ++++++++++-------- 1 file changed, 63 insertions(+), 46 deletions(-) diff --git a/frontend-modern/src/components/Settings/Settings.tsx b/frontend-modern/src/components/Settings/Settings.tsx index 2d17865eb..fedf13a6c 100644 --- a/frontend-modern/src/components/Settings/Settings.tsx +++ b/frontend-modern/src/components/Settings/Settings.tsx @@ -542,12 +542,17 @@ const Settings: Component = () => { const handleExport = async () => { if (!exportPassphrase()) { - showError(useCustomPassphrase() ? 'Please enter a passphrase' : 'Please enter your password'); + const hasAuth = securityStatus()?.hasAuthentication; + showError(hasAuth + ? (useCustomPassphrase() ? 'Please enter a passphrase' : 'Please enter your password') + : 'Please enter a passphrase'); return; } - if (useCustomPassphrase() && exportPassphrase().length < 12) { - showError('Custom passphrase must be at least 12 characters long'); + // Require 12 chars for custom passphrase or when no auth exists + const hasAuth = securityStatus()?.hasAuthentication; + if ((!hasAuth || useCustomPassphrase()) && exportPassphrase().length < 12) { + showError('Passphrase must be at least 12 characters long'); return; } @@ -1636,7 +1641,11 @@ const Settings: Component = () => { Download an encrypted backup of all nodes and settings