diff --git a/app/sites/[id]/settings/page.tsx b/app/sites/[id]/settings/page.tsx index f15283d..26b4ff8 100644 --- a/app/sites/[id]/settings/page.tsx +++ b/app/sites/[id]/settings/page.tsx @@ -57,7 +57,7 @@ export default function SiteSettingsPage() { const [scriptCopied, setScriptCopied] = useState(false) const [linkCopied, setLinkCopied] = useState(false) const [showVerificationModal, setShowVerificationModal] = useState(false) - const [isPasswordMasked, setIsPasswordMasked] = useState(false) + const [isPasswordEnabled, setIsPasswordEnabled] = useState(false) useEffect(() => { loadSite() @@ -76,7 +76,9 @@ export default function SiteSettingsPage() { excluded_paths: (data.excluded_paths || []).join('\n') }) if (data.has_password) { - setIsPasswordMasked(true) + setIsPasswordEnabled(true) + } else { + setIsPasswordEnabled(false) } } catch (error: any) { toast.error('Failed to load site: ' + (error.message || 'Unknown error')) @@ -99,7 +101,8 @@ export default function SiteSettingsPage() { name: formData.name, timezone: formData.timezone, is_public: formData.is_public, - password: isPasswordMasked ? undefined : (formData.password || undefined), + password: isPasswordEnabled ? (formData.password || undefined) : undefined, + clear_password: !isPasswordEnabled, excluded_paths: excludedPathsArray }) toast.success('Site updated successfully') @@ -447,27 +450,45 @@ export default function SiteSettingsPage() {
- Set a password to restrict access to the public dashboard. -
+Restrict access to this dashboard.
++ Visitors will need to enter this password to view the dashboard. +
+