Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running example #129

Open
MichaelJCole opened this issue Jun 18, 2013 · 3 comments
Open

Error running example #129

MichaelJCole opened this issue Jun 18, 2013 · 3 comments

Comments

@MichaelJCole
Copy link

Hey, I'm trying to run the example, but obviously doing it wrong.

Here's what I did:

git clone https://github.com/bnoguchi/mongoose-auth.git
cd mongoose-auth
npm install
cd example
node server.js

Here's what it did:

☔  node server.js                                                                                      master
Warning: express.createServer() is deprecated, express
applications no longer inherit from http.Server,
please use:

  var express = require("express");
  var app = express();

everyauth.helpExpress is being deprecated. helpExpress is now automatically invoked when it detects express. So remove everyauth.helpExpress from your code
TypeError: /home/michaelcole/scm/mongoose-auth/example/views/home.jade:1
  > 1| - if (!everyauth.loggedIn)
    2|   h2 Not Authenticated
    3|   #register
    4|     a(href='/register') Register

Cannot read property 'loggedIn' of undefined
    at eval (eval at <anonymous> (/home/michaelcole/scm/mongoose-auth/node_modules/jade/lib/jade.js:170:8), <anonymous>:7:15)
    at /home/michaelcole/scm/mongoose-auth/node_modules/jade/lib/jade.js:171:35
    at Object.exports.render (/home/michaelcole/scm/mongoose-auth/node_modules/jade/lib/jade.js:205:14)
    at View.exports.renderFile [as engine] (/home/michaelcole/scm/mongoose-auth/node_modules/jade/lib/jade.js:232:13)
    at View.render (/home/michaelcole/scm/mongoose-auth/node_modules/express/lib/view.js:76:8)
    at Function.app.render (/home/michaelcole/scm/mongoose-auth/node_modules/express/lib/application.js:506:10)
    at ServerResponse.res.render (/home/michaelcole/scm/mongoose-auth/node_modules/express/lib/response.js:756:7)
    at /home/michaelcole/scm/mongoose-auth/example/server.js:111:7
    at callbacks (/home/michaelcole/scm/mongoose-auth/node_modules/express/lib/router/index.js:161:37)
    at param (/home/michaelcole/scm/mongoose-auth/node_modules/express/lib/router/index.js:135:11)

What am I doing wrong?

@martinsookael
Copy link

  1. var app = express(); // that's fixable on line 98, with
    "var app = express.express.createServer(" to "var app = express("

  2. everyauth.helpExpress is being deprecated - that's line 120. I just commented it out.

  3. Cannot read property 'loggedIn' of undefined
    Well, that's why I'm here. UP.

@NTTAKR
Copy link

NTTAKR commented Aug 12, 2013

Well? Any more info on this?

@MichaelJCole
Copy link
Author

Hey, I ended up using PassportJS. I think it's the new hawtness and better maintained. Please contradict me if mongoose-auth is still actively developed.

http://passportjs.org/

Unworthy self-link:
https://github.com/MichaelJCole/passport-freshbooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants