My application is build with React which is completely separate from Meteor. I use Asteroid to interface to Meteor which serve as backend only. I have manually create the facebook login button at front end and want to pass those data fetched from facebook to Accounts.createUser. This method asked two parameters which is not available because I have formatted like so
Sorry that you have to use React You can directly userId = Meteor.users.insert(...) in your method and then call Meteor.connection.setUserId(userId) on the serverr and this.setUserId(userId) on the client (not sure though if Asteroid offers this on the client).
getLogin(data) {
if (!Accounts.findUserByEmail(data.services.facebook.email)) {
Meteor.users.insert(data)
} else {
//login user as usual with facebook implementation
}
}
which part that I have to set userId in client as well as server? Is there any event that I need to trigger? Appreciate your help