Skip to content

Instantly share code, notes, and snippets.

@thejh
Forked from anonymous/gist:1144983
Created August 14, 2011 15:30
Show Gist options
  • Save thejh/1144984 to your computer and use it in GitHub Desktop.
Save thejh/1144984 to your computer and use it in GitHub Desktop.
exports.auth = function(update) {
return function(req, res, next) {
isLogged(req, function(logged, key){
if (logged != update) return next()
if (!logged) return next(errors.fire(403))
redis.setex(key, 1000, req.session.id, function() {
next()
})
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment