Open abreups opened 10 years ago
I believe the author mentions in the book something about a bug that doesn't crash the server, however that's probably because he was using an old version of express. To fix this you should just add a check for the item, and res.send(400) if it doesn't exist or the item otherwise.
When a (new) user registers, /accounts/:id/activity in app.js is called but the value of req.session.accountId is undefined and the application on the server crashes with an error (because models.Account.findById is called with accountId == undefined). This "only" happens for a new user; existing users don't cause this problem. I've been trying to debug what is going on here for a while, but no success. My error or book code error? If anyone could provide some feedback I'd appreciate.