简体   繁体   English

如何在METEOR.js中使用Google登录时获取用户的电子邮件

[英]How to get user's email on sign in with google in METEOR.js

I am new to meteor . 我是新来的流星。 I wish to do a google+ sign in in meteor.js , I am using "accounts-ui" package and have put {{> loginButtons}} in the html file . 我希望在meteor.js中进行google +登录,我正在使用“ accounts-ui”包,并将{{> loginButtons}}放在html文件中。 Everything works just fine , except that I wish to access the email id of the user and I can not figure out how to access the response from google+ . 一切正常,除了我希望访问用户的电子邮件ID,而且我不知道如何从google +访问响应。

You could use the accountsClientOrServer.onLogin(func) callback, for example: 您可以使用accountsClientOrServer.onLogin(func)回调,例如:

Accounts.onLogin(function(user){
  console.log(user.user.services.google.email);
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM