Skip to content

Fix: delete account flow - #91

Open
kunal-10-cloud wants to merge 1 commit into
imkrishnasarathi:mainfrom
kunal-10-cloud:temp-delete
Open

Fix: delete account flow #91
kunal-10-cloud wants to merge 1 commit into
imkrishnasarathi:mainfrom
kunal-10-cloud:temp-delete

Conversation

@kunal-10-cloud

Copy link
Copy Markdown
Contributor

Fixes: #89
_ Summary_

This PR implements a functional Delete Account flow
The Delete Account button is now fully wired to the authentication context and performs all necessary cleanup actions before redirecting the user.

Changes
src/pages/Settings.jsx

Imported deleteAccount from useAuth.

Integrated the Delete Account button to call deleteAccount() upon confirmation in the delete modal.

Removed the duplicate

Account Settings

heading.

src/contexts/AuthContext.jsx

Added a new deleteAccount() method that:

Clears meal logs and favorites.

Deletes the user profile.

Ends user sessions and resets state.

Redirects the user to /.

Exposed deleteAccount through the context for usage across the app.

src/services/userRecipeService.js

Added a new helper method clearFavorites(userId) to bulk-delete all user favorites.

Test Plan

Log in and navigate to Settings → Account.

Verify that there is only one “Account Settings” heading.

Click Delete Account → Confirm.

Confirm that:

All user data (logs and favorites) is removed.

The session ends.

The user is redirected to the home page (/).

@vercel

vercel Bot commented Oct 19, 2025

Copy link
Copy Markdown

@kunal-10-cloud is attempting to deploy a commit to the krishnathecoder756's projects Team on Vercel.

A member of the Team first needs to authorize it.

@kunal-10-cloud

Copy link
Copy Markdown
Contributor Author

@imkrishnasarathi please take a look into the pr and suggest any changes if required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete Account button not working on the website

1 participant