Task F: Account Deletion
When the user decides to delete her account, we need to delete all the user-related information from the database, as well as all the user’s files. Luckily, we already wrote a function to delete individual images and their references. All we have to do is select all images associated with the user and pass them to this function. Then we have to remove the account from the users table and delete the user folder.
The picture-gallery.routes.auth namespace contains the logic related to authentication and user account management. We’ll navigate there and add the logic for account deletion by adding the delete-account-page function.
Account deletion will be applicable only to the user in session, obviously, so we need ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access