Overview
useConfirmAccountDeletion returns a function that submits the confirmation code from useRequestAccountDeletion and permanently deletes the authenticated user’s account. On success, the local session is torn down just like a sign-out: the deleted account is removed from the multi-account map, and the SDK switches to a remaining signed-in account if there is one (otherwise the user is fully logged out).
Usage Example
Parameters
The returned function accepts:The one-time confirmation code the user received by email. Must match the most recently issued code exactly.
Returns
The hook returns an async function that resolves tovoid on success. It throws if the code is invalid or expired, or if the deletion fails.
You don’t need to call
signOut afterward — the hook clears the local session
for you and switches to a remaining account if the user had several signed in.
