Merge pull request #714 from SISheogorath/fix/uncaughtException
Fix uncaught exception for non-existent user
This commit is contained in:
commit
2024262200
1 changed files with 5 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue