Error: WARNING: You are trying to access the attribute/method configured by `findUserById`, which you did not configure. Time to configure it. #344

Open
juzerali opened this Issue Sep 17, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@juzerali

I am getting this error in a code which was working just a few days ago.

Error: WARNING: You are trying to access the attribute/method configured by findUserById, which you did not configure. Time to configure it.
at Object.module.exports.configurable.(anonymous function) as findUserById
at Object.fetchUserFromSession as handle
at next (/home/juzer/Desktop/prshnpatra/node_modules/everyauth/node_modules/connect/lib/http.js:204:15)
at Object.registerReqGettersAndMethods as handle
at next (/home/juzer/Desktop/prshnpatra/node_modules/everyauth/node_modules/connect/lib/http.js:204:15)
at HTTPServer.Server.handle (/home/juzer/Desktop/prshnpatra/node_modules/everyauth/node_modules/connect/lib/http.js:217:3)
at Object.app.use.fn as handle
at next (/home/juzer/Desktop/prshnpatra/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at store.get.next (/home/juzer/Desktop/prshnpatra/node_modules/express/node_modules/connect/lib/middleware/session.js:302:9)
at /home/juzer/Desktop/prshnpatra/node_modules/express/node_modules/connect/lib/middleware/session.js:325:9

My Express code:

var express = require('express')
  , routes = require('./routes')
  , user = require('./routes/user')
  , http = require('http')
  , path = require('path');

var app = express();


everyauth = require("everyauth");

everyauth.debug = true;

everyauth.facebook.appId("<app Id>")
.appSecret("<app secret>")
.handleAuthCallbackError(function(req, res) {}).findOrCreateUser(function(session, accessToken, accessTokExtra, fbUserMetadata) {
  var promise;
  return promise = this.Promise().fulfill(fbUserMetadata);
}).redirectPath("/users");

app.configure(function(){
  app.set('port', process.env.PORT || 3000);
  app.set('views', __dirname + '/views');
  app.set('view engine', 'jade');
  app.use(express.favicon());
  app.use(express.logger('dev'));
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(express.cookieParser('your secret here'));
  app.use(express.session({secret: "secret-cat"}));
  app.use(everyauth.middleware());
  app.use(app.router);
  app.use(express.static(path.join(__dirname, 'public')));
});

app.configure('development', function(){
  app.use(express.errorHandler());
});

app.get('/', routes.index);
app.get('/users', user.list);

http.createServer(app).listen(app.get('port'), function(){
  console.log("Express server listening on port " + app.get('port'));
});

The same code was working just a few days ago. After I reinstalled everyauth I am getting this error. Has something changed in the recent build?

@juzerali

This comment has been minimized.

Show comment Hide comment
@juzerali

juzerali Sep 18, 2012

Configuring findUserById makes it work. But earlier it used to run without it also. Keeping it open to know if something has changed in last few weeks.

Configuring findUserById makes it work. But earlier it used to run without it also. Keeping it open to know if something has changed in last few weeks.

@wolli2710

This comment has been minimized.

Show comment Hide comment
@wolli2710

wolli2710 Oct 7, 2012

hi juzerali how does your method findUserById look like?

hi juzerali how does your method findUserById look like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment