Created
July 16, 2014 14:02
-
-
Save dburles/196143a2cda1023f2116 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
// Link service accounts when signed in | |
orig_updateOrCreateUserFromExternalService = Accounts.updateOrCreateUserFromExternalService; | |
Accounts.updateOrCreateUserFromExternalService = function(serviceName, serviceData, options) { | |
var loggedInUser = Meteor.user(); | |
if (loggedInUser) { | |
var setAttr = {}; | |
setAttr['linkedServices.' + serviceName] = serviceData; | |
Meteor.users.update(loggedInUser._id, { $set: setAttr }); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment