2013-08-21 30 views
2

我正在尋找一個Meteor.loginWithGoogle(與流星0.6.4.1)的工作示例。如何使用Meteor.loginWithGoogle獲取Google+個人資料?

我發現這一個用於loginWithGitHub(https://www.eventedmind.com/posts/meteor-customizing-login),它可以很好地與GitHub配合使用。

它工作正常,無參數顯示在這裏客戶端:

Template.user_loggedout.events({ 
    "click #login": function(e, tmpl){ 
    Meteor.loginWithGoogle({ 

    }, function (err) { 
     if(err) { 
      //error handling 
      alert('error : '+err.message); 
     } else { 

     } 
    }); 
    } 
}); 

與服務器端的賬戶PARAMS:

Accounts.loginServiceConfiguration.remove({ 
    service: 'google' 
}); 

Accounts.loginServiceConfiguration.insert({ 
    service: 'google', 
    clientId: 'XXXXXX', 
    secret: 'YYYYYY' 
}); 

在這種情況下,我怎麼能得到currentUser信息特別是郵件? 有沒有辦法讓用戶的Google+個人資料(如果他有一個並允許),例如用戶的頭像? requestPermissions需要的參數是什麼:,我能得到什麼?

感謝

回答

相關問題