与Meteor合并多个用户帐户 [英] Merging multiple user accounts with Meteor

查看:111
本文介绍了与Meteor合并多个用户帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于将多个用户帐户与Meteor合并,有一篇很好的文章: http://www.meteorpedia.com / read / Merging_OAuth_accounts

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

我已经有一个登录用户。我想让当前登录的用户登录到Facebook和Linkedin,并合并所有服务对象。为此,我创建了一个Account.onCreateUser()函数

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

在onCreateUser()函数中,我需要检索以下信息:

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


  1. 当前用户ID:我尝试过this.userId,它不起作用

  2. 当前SessionId:在客户端Meteor.data_connection._lastSessionId中。不确定如何在服务器中获取它。

任何帮助都是非常有用的。

Any help is very useful.

推荐答案

合并多个帐户的最佳方法是在Accounts.onCreateUser中编写自定义代码。在这种方法中,无法检索会话ID。在迁移帐户后,应根据会话ID迁移用户数据。另外,为使this.userId在Accounts.onCreateUser中起作用,请不要在Meteor.startup中创建新用户。

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.

这篇关于与Meteor合并多个用户帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆