We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a06c6a9 commit f49313fCopy full SHA for f49313f
server/services/passport.js
@@ -16,9 +16,12 @@ passport.use(
16
User.findOne({ googleId: profile.id }).then(existingUser => {
17
if (existingUser) {
18
// we already have a record with the given profile ID
19
+ done(null, existingUser);
20
} else {
21
// we don't have a user record with this ID, make a new record!
- new User({ googleId: profile.id }).save();
22
+ new User({ googleId: profile.id })
23
+ .save()
24
+ .then(user => done(null, user));
25
}
26
});
27
0 commit comments