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 no other account is activated, even if the user has others signed in. The app renders signed-out.
Deleting an account ends the session and leaves nothing active, even when other accounts remain stored — read
activeAccount from useAccounts and render your own next screen when it is null.Usage Example
Parameters
The returned function accepts:string
required
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. Any other stored accounts stay in the map, but none of them is
activated; the app lands signed-out with the account picker available.
