Created
February 29, 2016 18:32
-
-
Save bdunnette/e2bbf249573a89333b0d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Meteor.isServer) { | |
Accounts.onCreateUser(function(options, user) { | |
// Create blank user.emails field if it doesn't already exist | |
user.emails = user.emails || []; | |
if (user.services && user.services.google) { | |
// Add Google email address to user.emails - fixes issues with some packages that expect this field, e.g. yogiben-admin | |
user.emails.push({ | |
address: user.services.google.email, | |
verified: user.services.google.verified_email | |
}); | |
} | |
return user; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment