Implementation of Social Authentication III - Does not login on first try

What is your hint or solution suggestion?

As we are using the node driver for Mongo, the appropriate options object should be:

{ upsert: true, returnOriginal: false }

Otherwise, the document returned is the original (null) which will fail to login.

Challenge: Implementation of Social Authentication III

Link to the challenge:

1 Like

Just completed/troubleshooted this challenge, hopefully FCC can update its code block in the tutorial to {upsert: true, returnDocument: ‘after’} (returnOriginal is deprecated) . In addition, username: profile.displayName || profile.username should be used instead of name: profile.displayName || 'John Doe', because

  1. in the previous challenge “How to Put a Profile Together”, {username: req.user.username} was used in the argument for res.render for /profile

  2. profile.username has a value in the profile returned from Github.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.