Merging multiple user accounts with Meteor

放肆的年华 提交于 2019-12-11 10:35:05

问题


There is a good article on merging multiple user accounts with Meteor: http://www.meteorpedia.com/read/Merging_OAuth_accounts

I have an already logged in user. I want to the currently logged in user to login to Facebook and Linkedin and merge all the service objects. For this, I have created an Account.onCreateUser() function

Within the onCreateUser() function, I require to retrieve the following information:

  1. current UserId: I tried this.userId, it is not working
  2. current SessionId: in client, Meteor.data_connection._lastSessionId. Not sure how to get this in the server.

Any help is very useful.


回答1:


I'm using package meteor-accounts-meld




回答2:


The best way to merge multiple accounts is writing custom code in Accounts.onCreateUser. Within this method, retrieving session Id does not work. Migration of user data based on session Id should happen after accounts are migrated. Also, for this.userId to work within Accounts.onCreateUser, do not create new users in Meteor.startup.



来源:https://stackoverflow.com/questions/35124299/merging-multiple-user-accounts-with-meteor

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!