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

查看:27
本文介绍了使用 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. current SessionId:在客户端,Meteor.data_connection._lastSessionId.不确定如何在服务器中获取它.

任何帮助都非常有用.

推荐答案

合并多个帐户的最佳方法是在 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天全站免登陆