diff --git a/facebook/verify.go b/facebook/verify.go index 67a25d2..aab9934 100644 --- a/facebook/verify.go +++ b/facebook/verify.go @@ -12,9 +12,14 @@ const facebookAPI = "https://graph.facebook.com/v2.9/" // // Note that user ids are unique to each app. type User struct { - ID string `json:"id"` - Name string `json:"name"` - Email string `json:"email"` + ID string `json:"id"` + Name string `json:"name"` + Email string `json:"email"` + Picture struct { + Data struct { + URL string `json:"url"` + } `json:"data"` + } `json:"picture"` } // client is a Facebook client for obtaining the current User. @@ -36,6 +41,6 @@ func (c *client) Me() (*User, *http.Response, error) { // Facebook returns JSON as Content-Type text/javascript :( // Set Accept header to receive proper Content-Type application/json // so Sling will decode into the struct - resp, err := c.sling.New().Set("Accept", "application/json").Get("me?fields=name,email").ReceiveSuccess(user) + resp, err := c.sling.New().Set("Accept", "application/json").Get("me?fields=name,email,picture").ReceiveSuccess(user) return user, resp, err }