Merge pull request #714 from SISheogorath/fix/uncaughtException

Fix uncaught exception for non-existent user
This commit is contained in:
Christoph (Sheogorath) Kern 2018-01-31 20:48:59 +01:00 committed by GitHub
commit 2024262200
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,11 @@ passport.deserializeUser(function (id, done) {
id: id
}
}).then(function (user) {
// Don't die on non-existent user
if (user == null) {
return done(null, false, { message: 'Invalid UserID' })
}
logger.info('deserializeUser: ' + user.id)
return done(null, user)
}).catch(function (err) {