medium10 pts · first answer countssecurityapi-design
Saving req.body directly
What is the main problem with this "update my profile" endpoint?
app.patch('/me', auth, async (req, res) => {
await db.user.update({ where: { id: req.user.id }, data: req.body })
res.sendStatus(204)
})Discussion 0
Join free to post in the discussion.
Related questions
- Stopping SQL injectionBackend Developer
- How to store passwordsBackend Developer
- Keeping secrets out of codeBackend Developer
- Database user for the appBackend Developer
- Response for a successful DELETEBackend Developer
- A product page removed for goodBackend Developer
- Signing up with a taken usernameBackend Developer
- Calling DELETE on a read-only routeBackend Developer