Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6603177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:58:26+00:00 2026-05-25T18:58:26+00:00

Using everyauth, the first time a user login, a profile is added to my

  • 0

Using everyauth, the first time a user login, a profile is added to my mongodb via mongoose and the session works well. The second time a user tries to login, the server crashes with the following error:

/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/modules/everymodule.js:352
throw err;

^ TypeError: Cannot read property ‘id’ of undefined at
Object._addToSession
(/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/modules/oauth2.js:195:46)
at Object.exec
(/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/step.js:48:21)
at
/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/stepSequence.js:19:38
at [object Object].fulfill
(/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/promise.js:42:25)
at
/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/stepSequence.js:22:23
at [object Object].callback
(/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/promise.js:13:12)
at
/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/stepSequence.js:21:23
at [object Object].fulfill
(/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/promise.js:42:25)
at
/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/stepSequence.js:22:23
at [object Object].fulfill
(/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/promise.js:42:25)

The following is my code:

.findOrCreateUser( function (session, accessToken, accessTokExtra, fbUserMetadata) {
//Verifies if user in database already
try{
var id = fbUserMetadata.id;
var promise = this.Promise();
User.findOne({ fbid: id}, function(err, result) {
var user;
if(!result) {
user = new User();
user.fbid = id;
user.firstName = fbUserMetadata.first_name;
user.lastName = fbUserMetadata.last_name;
user.save();
} else {
user = result.doc;
}
promise.fulfill(user);
});
return promise;
}
catch(err){
console.log(err);

}
})

I use mongoose and express.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:58:27+00:00Added an answer on May 25, 2026 at 6:58 pm

    Untested, but from looking at your code, it looks like you need to change this line:

    user = result.doc;
    

    to this:

    user = result;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using everyauth, when I login with a never autenticated before user on my website,
Using C#, I need a class called User that has a username, password, active
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
using linux commands, I have a quoted csv file which I sorted by first
Using Maven to build my project under windows works fine, but when I build
Using online interfaces to a version control system is a nice way to have
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C# .NET 3.5 and WCF, I'm trying to write out some of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.