Is there a way to delete a user's own account only after OTP verification in order to confirm his identity? The OTP can be sent to either email or mobile number depending on what they used for account creation. How can I configure this OTP flow?
// delete user
async function deleteUser() {
try {
const result = await Auth.deleteUser();
console.log(result);
} catch (error) {
console.log('Error deleting user', error);
}
}