Skip to content

Loading…

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

Merged
merged 1 commit into from

2 participants

@visnup

happens to me because I reset my development database, but my session thinks I'm still logged in yet can't find the right record anymore.

@bnoguchi
Owner

Cool. Thanks for the patch.

@bnoguchi bnoguchi merged commit a04be9d into bnoguchi:master
@visnup

no prob. using mongoose-auth for the nko site. it's pretty sweet.
related, are you thinking of competing or wanna be a judge? :)

@bnoguchi
Owner

Last year's was really awesome, so I'm definitely planning on participating, again. What's involved for the judging process? I'll message you my gmail to follow up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 13, 2011
  1. if user isn't successfully found, then clear out the session.

    visnu pitiyanuvath committed
Showing with 1 addition and 0 deletions.
  1. +1 −0 index.js
View
1 index.js
@@ -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();
});
Something went wrong with that request. Please try again.