3

I'm looking for a working example of Meteor.loginWithGoogle (with meteor 0.6.4.1).

I found this one for loginWithGitHub (https://www.eventedmind.com/posts/meteor-customizing-login) that works fine with GitHub.

It works fine without parameters as show here on client side :

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

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

        }
    });
  }
});

with the Accounts params on server side :

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

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

In this case how can i get currentUser information especially the mail ? Is there a way to get the Google+ profile of the user (if he has one and allows this), the user's avatar for example ? What are the needed parameters for requestPermissions: , what can i get with this ?

Thanks

Laurent Roger
  • 198
  • 1
  • 9