Loading CHANGELOG.md +2 −0 Original line number Original line Diff line number Diff line Loading @@ -8,6 +8,8 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr - Make metrics prefix configurable, default to fixed value. - Make metrics prefix configurable, default to fixed value. - Build with Go 1.15.5 release. - Build with Go 1.15.5 release. - Skip logging Lua errors raised by explicit runtime calls to the `error({msg, code})` built-in. - Skip logging Lua errors raised by explicit runtime calls to the `error({msg, code})` built-in. - Update to Facebook Graph API v9.0. - Facebook authentication no longer requires access to gender, locale, and timezone data. ### Fixed ### Fixed - Better handling of SSL connections in development configurations. - Better handling of SSL connections in development configurations. Loading social/social.go +6 −9 Original line number Original line Diff line number Diff line Loading @@ -81,9 +81,6 @@ type FacebookProfile struct { ID string `json:"id"` ID string `json:"id"` Name string `json:"name"` Name string `json:"name"` Email string `json:"email"` Email string `json:"email"` Gender string `json:"gender"` Locale string `json:"locale"` Timezone float64 `json:"timezone"` } } type facebookPagingCursors struct { type facebookPagingCursors struct { Loading Loading @@ -194,8 +191,8 @@ dAUK75fDiSKxH3fzvc1D1PFMqT+1i4SvZPLQFCE= func (c *Client) GetFacebookProfile(ctx context.Context, accessToken string) (*FacebookProfile, error) { func (c *Client) GetFacebookProfile(ctx context.Context, accessToken string) (*FacebookProfile, error) { c.logger.Debug("Getting Facebook profile", zap.String("token", accessToken)) c.logger.Debug("Getting Facebook profile", zap.String("token", accessToken)) path := "https://graph.facebook.com/v5.0/me?access_token=" + url.QueryEscape(accessToken) + path := "https://graph.facebook.com/v9.0/me?access_token=" + url.QueryEscape(accessToken) + "&fields=" + url.QueryEscape("name,email,gender,locale,timezone") "&fields=" + url.QueryEscape("name,email") var profile FacebookProfile var profile FacebookProfile err := c.request(ctx, "facebook profile", path, nil, &profile) err := c.request(ctx, "facebook profile", path, nil, &profile) if err != nil { if err != nil { Loading @@ -213,7 +210,7 @@ func (c *Client) GetFacebookFriends(ctx context.Context, accessToken string) ([] after := "" after := "" for { for { // In FB Graph API 2.0+ this only returns friends that also use the same app. // In FB Graph API 2.0+ this only returns friends that also use the same app. path := "https://graph.facebook.com/v5.0/me/friends?access_token=" + url.QueryEscape(accessToken) path := "https://graph.facebook.com/v9.0/me/friends?access_token=" + url.QueryEscape(accessToken) if after != "" { if after != "" { path += "&after=" + after path += "&after=" + after } } Loading Loading
CHANGELOG.md +2 −0 Original line number Original line Diff line number Diff line Loading @@ -8,6 +8,8 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr - Make metrics prefix configurable, default to fixed value. - Make metrics prefix configurable, default to fixed value. - Build with Go 1.15.5 release. - Build with Go 1.15.5 release. - Skip logging Lua errors raised by explicit runtime calls to the `error({msg, code})` built-in. - Skip logging Lua errors raised by explicit runtime calls to the `error({msg, code})` built-in. - Update to Facebook Graph API v9.0. - Facebook authentication no longer requires access to gender, locale, and timezone data. ### Fixed ### Fixed - Better handling of SSL connections in development configurations. - Better handling of SSL connections in development configurations. Loading
social/social.go +6 −9 Original line number Original line Diff line number Diff line Loading @@ -81,9 +81,6 @@ type FacebookProfile struct { ID string `json:"id"` ID string `json:"id"` Name string `json:"name"` Name string `json:"name"` Email string `json:"email"` Email string `json:"email"` Gender string `json:"gender"` Locale string `json:"locale"` Timezone float64 `json:"timezone"` } } type facebookPagingCursors struct { type facebookPagingCursors struct { Loading Loading @@ -194,8 +191,8 @@ dAUK75fDiSKxH3fzvc1D1PFMqT+1i4SvZPLQFCE= func (c *Client) GetFacebookProfile(ctx context.Context, accessToken string) (*FacebookProfile, error) { func (c *Client) GetFacebookProfile(ctx context.Context, accessToken string) (*FacebookProfile, error) { c.logger.Debug("Getting Facebook profile", zap.String("token", accessToken)) c.logger.Debug("Getting Facebook profile", zap.String("token", accessToken)) path := "https://graph.facebook.com/v5.0/me?access_token=" + url.QueryEscape(accessToken) + path := "https://graph.facebook.com/v9.0/me?access_token=" + url.QueryEscape(accessToken) + "&fields=" + url.QueryEscape("name,email,gender,locale,timezone") "&fields=" + url.QueryEscape("name,email") var profile FacebookProfile var profile FacebookProfile err := c.request(ctx, "facebook profile", path, nil, &profile) err := c.request(ctx, "facebook profile", path, nil, &profile) if err != nil { if err != nil { Loading @@ -213,7 +210,7 @@ func (c *Client) GetFacebookFriends(ctx context.Context, accessToken string) ([] after := "" after := "" for { for { // In FB Graph API 2.0+ this only returns friends that also use the same app. // In FB Graph API 2.0+ this only returns friends that also use the same app. path := "https://graph.facebook.com/v5.0/me/friends?access_token=" + url.QueryEscape(accessToken) path := "https://graph.facebook.com/v9.0/me/friends?access_token=" + url.QueryEscape(accessToken) if after != "" { if after != "" { path += "&after=" + after path += "&after=" + after } } Loading