Skip to content

Instantly share code, notes, and snippets.

Created August 9, 2012 03:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3300579 to your computer and use it in GitHub Desktop.
Save anonymous/3300579 to your computer and use it in GitHub Desktop.
express.js bug
// check if user is logged in.
nano.request({
method: "GET",
db: "_session",
headers: {
"cookie": req.headers.cookie // maybe this is the problem.
}
}, function(err, body, headers) {
if ( !! err) {
console.log(err); // Here's where I get the error.
return res.redirect('/dash'); // The redirect works just fine though.
} else {
if ( !! body.userCtx.name) { // if user is logged in...
var userObj = body.userCtx; // capture userCtx Object
//.......and so on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment