bnoguchi / everyauth

node.js auth package (password, facebook, & more) for Connect and Express apps
http://everyauth.com/
3.49k stars 447 forks source link

everyauth express helpers and swig templates #355

Open voronianski opened 12 years ago

voronianski commented 12 years ago

I use swig template engine (via https://github.com/visionmedia/consolidate.js) with express 3.x but I express helpers doesn't work at all..

{{ everyauth.loggedIn }} doesn't return anything..

what 's the problem?

thanks!

voronianski commented 12 years ago

the problem is that "everyauth is not defined" but I tried to use middleware - app.use(everyauth.middleware(app));

express "3.0.0rc5"

fruchtose commented 12 years ago

I'm also seeing this issue with Express 3.0.0, although I am not using swig. I poked around in index.js, and I believe the problem has something to do with this snippet:

if (! (handle && handle.everyauth)) {
  return oldUse.call(this, route, handle);
}

It appears that the condition always returns true (the variable handle is null), and the everyauth helper is never defined as a result.