On the profile page, there should be a button called "delete account." When pressed, a confirmation modal should appear to make sure the user wants to. After confirming, the account is deleted and the user is logged out.
Game plan
[x] do the dessert problem
[x] add a "delete account" button the profile page
[x] when the button is pressed, show a modal that says
"Are you sure you want to delete your account? All your data will be removed from out database."
with the options "Yes, delete" or "Cancel"
use the reset password modal as an example
[x] when the cancel or delete button is pressed, close the modal.
[x] add logic to call the /delete endpoint in the below file if the user confirms
On the profile page, there should be a button called "delete account." When pressed, a confirmation modal should appear to make sure the user wants to. After confirming, the account is deleted and the user is logged out.
Game plan
"Are you sure you want to delete your account? All your data will be removed from out database."
with the options "Yes, delete" or "Cancel"
use the reset password modal as an example
[x] when the cancel or delete button is pressed, close the modal.
[x] add logic to call the
/delete
endpoint in the below file if the user confirms[x] refactor the below file, to add a new case where if a user is authenticated AND their email in the JSON token matches the supplied email, allow them to delete their account https://github.com/SCE-Development/Clark/blob/a5e6ae85da14f827062d3f5d431083cc8e5edf82/api/main_endpoints/routes/User.js#L96