diff options
author | Christoph (Sheogorath) Kern | 2018-01-31 20:48:59 +0100 |
---|---|---|
committer | GitHub | 2018-01-31 20:48:59 +0100 |
commit | 20242622004edc2438ecb6f59feab0b9eddc6280 (patch) | |
tree | 78f05eb132e9405971b90a1bd448a6a10c6157bd | |
parent | 1a4800e21a2d10b51ff8464804b877b384662eea (diff) | |
parent | eddf8a3a33cde7d373775713cae9a431322b673d (diff) |
Merge pull request #714 from SISheogorath/fix/uncaughtException
Fix uncaught exception for non-existent user
Diffstat (limited to '')
-rw-r--r-- | lib/web/auth/index.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/web/auth/index.js b/lib/web/auth/index.js index db5ff11d..9ab62c25 100644 --- a/lib/web/auth/index.js +++ b/lib/web/auth/index.js @@ -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) { |