🎯 What you'll practice: Planning a fully authenticated backend, combining Lessons 25–27.
1-B 2-B 3-B 4-B | 5 = password 6 = user 7 = Task.find({userId: req.user.id}); 8 = Load the task, compare task.userId to req.user.id, and return 403 (or 404) if they don't match, before performing the delete 9 = Because storing plain-text passwords is a real security habit being learned — even practice projects should follow production-safe patterns since bad habits carry into real applications | 10 = app.delete('/api/tasks/:id',protect,async(req,res)=>{const t=await Task.findById(req.params.id);if(!t)return res.status(404).json({error:'Not found'});if(t.userId.toString()!==req.user.id)return res.status(403).json({error:'Forbidden'});await t.deleteOne();res.status(204).send();});