From 1c916bb598bc8b330f4761b612e1ba037e77b376 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Wed, 25 Mar 2026 22:05:01 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20deleteAccount=20requires=20password=20?= =?UTF-8?q?=E2=80=94=20add=20password=20input=20to=20delete=20flow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unified/tabs/AccountProfileTab.tsx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/components/settings/unified/tabs/AccountProfileTab.tsx b/components/settings/unified/tabs/AccountProfileTab.tsx index b7ff11d..306d1c0 100644 --- a/components/settings/unified/tabs/AccountProfileTab.tsx +++ b/components/settings/unified/tabs/AccountProfileTab.tsx @@ -14,6 +14,7 @@ export default function AccountProfileTab({ onDirtyChange, onRegisterSave }: { o const hasInitialized = useRef(false) const [showDeleteConfirm, setShowDeleteConfirm] = useState(false) const [deleteText, setDeleteText] = useState('') + const [deletePassword, setDeletePassword] = useState('') const [deleting, setDeleting] = useState(false) useEffect(() => { @@ -46,10 +47,10 @@ export default function AccountProfileTab({ onDirtyChange, onRegisterSave }: { o }, [handleSave, onRegisterSave]) const handleDelete = async () => { - if (deleteText !== 'DELETE') return + if (deleteText !== 'DELETE' || !deletePassword) return setDeleting(true) try { - await deleteAccount() + await deleteAccount(deletePassword) logout() } catch (err) { toast.error(getAuthErrorMessage(err as Error) || 'Failed to delete account') @@ -110,6 +111,16 @@ export default function AccountProfileTab({ onDirtyChange, onRegisterSave }: { o
  • All sessions and trusted devices
  • You will be removed from all organizations
  • +
    + + setDeletePassword(e.target.value)} + className="w-full px-3 py-2 border border-neutral-700 rounded-lg bg-neutral-900 text-white text-sm" + placeholder="Enter your password" + /> +
    -