Permalink
Browse files

if user isn't successfully found, then clear out the session.

  • Loading branch information...
visnu pitiyanuvath
visnu pitiyanuvath committed Jul 13, 2011
1 parent e4f7585 commit c94c56af309f9b0b69162dbd619bd04880f604ce
Showing with 1 addition and 0 deletions.
  1. +1 −0 index.js
View
@@ -42,6 +42,7 @@ everyauth.middleware = function () {
everymodule._findUserById(auth.userId, function (err, user) {
if (err) throw err; // TODO Leverage everyauth's error handling
if (user) req.user = user;
+ else delete sess.auth;
next();
pause.resume();
});

0 comments on commit c94c56a

Please sign in to comment.