1

Hey I'm trying to configure findUserById to use the everyauth.user helper method in the view.

Here is my configuration:

everyauth.everymodule.userPkey('_id');

everyauth.everymodule.findUserById( function (userId, callback) {
  dbManager.findById('brands', userId, function(error, brand) { 
    console.log(brand)
    if (error) return callback(error);
    callback(null, brand);
  });
});

the console.log(brand) gives me:

{ fbID: '507246960',
  brandName: '',
  email: 'alexfoxy@gmail.com',
  created_at: Thu Nov 29 2012 11:01:53 GMT+0000 (GMT),
  comments: [],
  _id: 50b740a1b47637ac54000001 }

So I know that the database is returning the user, however #{everyauth.user.email} in the view gives me the error:

Cannot read property 'name' of undefined So it's still undefined?!

Alex Fox
  • 1,175
  • 2
  • 15
  • 27

0 Answers0