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
2 changes: 2 additions & 0 deletions server/routes/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ router.get("/:id", requireValidId, async (req, res) => {
});

// UPDATE a profile — only the logged-in user can edit their own profile
// this update does not enforce uniqueness, so even though a user must create a profile with a unique email/username,
// they can change it to an existing one. I would recommend adding the same checks that the register path has.
router.put("/:id", requireValidId, async (req, res) => {
try {
if (req.params.id !== req.user._id.toString()) {
Expand Down