How to configure the amount of information that I collect from Google OAuth in the MeteorJS package?

Tried searching on google and StackOverflow, but no luck, maybe your knowledge of Google-OAuth can help ...

I installed the google-oauth base package through a meteorite.

meteor add accounts-ui
meteor add accounts-google

Then I tested it and saw that it asks the user to allow access to 2 main groups of information, the first of which is the user's email, and the second is the "basic information" about the user account, for example. Name, gender, profile URL, etc.

I just want an email and no other information. I tried to find where the URI request is built in my meteor application, someurlprobablygoogle.com/scope=email&profile or something else, but I can not find it.

+4
source share
1 answer

To set up Google OAuth in Meteor, you need meteor add service-configurationand meteor add accounts-google.

You should be able to change the parameter requestPermissionswhen calling your login method as follows:

Meteor.loginWithGoogle({
 requestPermissions: ['email']
}, function (err) {
  if (err)
  Session.set('errorMessage', err.reason || 'Unknown error');
});

Shooooots

+7
source

Source: https://habr.com/ru/post/1530789/


All Articles