How to retrieve facebook information from profile?


#1

I’m using Meteor.loginWithFacebook

The user is storing as:

{
	"_id" : "cnzMXwmvtF42Dfy4q",
	"createdAt" : ISODate("2016-08-31T15:58:00.814Z"),
	"services" : {
		"facebook" : {
			"accessToken" : "randomtoken",
			"expiresAt" : 1477842969226,
			"id" : "randomid",
			"email" : "example@example.com",
			"name" : "Name",
			"first_name" : "Firstname",
			"last_name" : "Lastname",
			"link" : "https://www.facebook.com/...",
			"gender" : "male",
			"locale" : "en_US",
			"age_range" : {
				"min" : 21
			}
		},
		"resume" : {
			"loginTokens" : [
				{
					"when" : ISODate("2016-08-31T15:58:00.818Z"),
					"hashedToken" : "randomtoken"
				}
			]
		}
	},
	"profile" : {
		"name" : "Firstname"
	}
}

But when I do:
console.log(Meteor.user().services);

It returns as undefined.

But if I do console.log(Meteor.user().profile); it brings the name correctly.

Question

How do I retrieve the facebook information in meteor?