The db schema has user with a profile_image_url field which is set in passport.js when the user logs in with twitter. However, when the user does login the code also tries to UPDATE the user record with avatar_image_url which fails and crashes the app.
Line 65 helpers/index.jsdb.query('UPDATE user SET avatar_image_url = ? WHERE id = ?', [res.req.url, user.id], function (err, result) {...stuff....})
In the template layout.jade we can see the following lines...
...where it shows that either one or the other is possible (and expected). Meanwhile, most of the rest of the templates are expecting user.avatar_image_url.
The db schema has
user
with aprofile_image_url
field which is set inpassport.js
when the user logs in with twitter. However, when the user does login the code also tries toUPDATE
theuser
record withavatar_image_url
which fails and crashes the app.Line 65
helpers/index.js
db.query('UPDATE user SET avatar_image_url = ? WHERE id = ?', [res.req.url, user.id], function (err, result) {...stuff....})
In the template
layout.jade
we can see the following lines......where it shows that either one or the other is possible (and expected). Meanwhile, most of the rest of the templates are expecting
user.avatar_image_url
.Is the
user
db scheme correct?