mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Return all basic google and facebook profile fields
This commit is contained in:
@@ -9,12 +9,18 @@
|
||||
var identity = getIdentity(accessToken);
|
||||
|
||||
var serviceData = {
|
||||
id: identity.id,
|
||||
accessToken: accessToken,
|
||||
email: identity.email,
|
||||
expiresAt: (+new Date) + (1000 * response.expiresIn)
|
||||
};
|
||||
|
||||
// include all fields from facebook
|
||||
// http://developers.facebook.com/docs/reference/login/public-profile-and-friend-list/
|
||||
var whitelisted = ['id', 'email', 'name', 'first_name',
|
||||
'last_name', 'link', 'username', 'gender', 'locale', 'age_range'];
|
||||
|
||||
var fields = _.pick(identity, whitelisted);
|
||||
_.extend(serviceData, fields);
|
||||
|
||||
return {
|
||||
serviceData: serviceData,
|
||||
options: {profile: {name: identity.name}}
|
||||
|
||||
@@ -7,12 +7,18 @@
|
||||
var identity = getIdentity(accessToken);
|
||||
|
||||
var serviceData = {
|
||||
id: identity.id,
|
||||
accessToken: accessToken,
|
||||
email: identity.email,
|
||||
expiresAt: (+new Date) + (1000 * response.expiresIn)
|
||||
};
|
||||
|
||||
// include all fields from google
|
||||
// https://developers.google.com/accounts/docs/OAuth2Login#userinfocall
|
||||
var whitelisted = ['id', 'email', 'verified_email', 'name', 'given_name',
|
||||
'family_name', 'picture', 'locale', 'timezone', 'gender'];
|
||||
|
||||
var fields = _.pick(identity, whitelisted);
|
||||
_.extend(serviceData, fields);
|
||||
|
||||
// only set the token in serviceData if it's there. this ensures
|
||||
// that we don't lose old ones (since we only get this on the first
|
||||
// log in attempt)
|
||||
|
||||
Reference in New Issue
Block a user