You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is intended or not, but serviceAddedCallback does not fire when a user that is not logged in tries to login with a service that another user has a verified email matching (this happens at line 593 of accounts-meld-server.js).
The reason I had to get this to fire is because I have an onCreateUser callback that fires when someone logs in with Facebook for the first time that copies info into the user.profile object.
In order to make this happen I called the original function storing the return value (to be returned after), called the callback and returned the return value. Reason for calling the original function is so that it copies the new service data into the user.
All works. I'm not great with git/github so here is the code I used starting from line 633 of accounts-meld-server.js:
// Now calls original updateOrCreateUserFromExternalService
var returnValue = origUpdateOrCreateUserFromExternalService.apply(this, arguments);
// Updates the registered_emails field
AccountsEmailsField.updateEmails({
user: otherUser
});
// Need to also call serviceAddedCallback when a service is added to a non-logged in user
var serviceAddedCbk = AccountsMeld.getConfig('serviceAddedCallback');
if (serviceAddedCbk) {
serviceAddedCbk(otherUser._id, serviceName);
}
// Return the previous return value here to avoid calling
// original function again
return returnValue;
Hope this helps. Dave
The text was updated successfully, but these errors were encountered:
Hey,
Not sure if this is intended or not, but serviceAddedCallback does not fire when a user that is not logged in tries to login with a service that another user has a verified email matching (this happens at line
593 of accounts-meld-server.js
).The reason I had to get this to fire is because I have an onCreateUser callback that fires when someone logs in with Facebook for the first time that copies info into the user.profile object.
In order to make this happen I called the original function storing the return value (to be returned after), called the callback and returned the return value. Reason for calling the original function is so that it copies the new service data into the user.
All works. I'm not great with git/github so here is the code I used starting from line
633 of accounts-meld-server.js
:Hope this helps. Dave
The text was updated successfully, but these errors were encountered: