Methods

deleteAccount

This method allows to delete the user from the database. All you need is to pass the email. Here is a demo code.

import { deleteAccount } from "@/actions/anjum";
 
const handleDeleteAccount = async ()=> {
    const res = await deleteAccount({email: email});
    return res;
};
// returns {success: boolean , message: string}

Always add confirmation modals and notifications to let the user delete their account.

Warning

This can't be undone !

On this page

No Headings