Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/pages/ProfilePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function ProfilePage({ currentUser, onUserChange }) {
await fetch(`/api/users/${currentUser._id}`, { method: "DELETE" });
// clear the app-wide user, then back to the homepage — the account is gone,
// so a login form is the one page they can't use
// I would recommend error handling here so if the DELETE fails, the user isn't logged out and is instead shown a message.
onUserChange(null);
navigate("/");
}
Expand Down