Skip to content

Commit 4d463a7

Browse files
author
Syed Zubairuddin
committed
Rename bio to about
In the v2.8 update of Facebook, the bio field has been replaced with about.
1 parent e8903ba commit 4d463a7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

providers/facebook/facebook.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ import (
66
"bytes"
77
"encoding/json"
88
"errors"
9-
"github.com/markbates/goth"
10-
"golang.org/x/oauth2"
119
"io"
1210
"io/ioutil"
1311
"net/http"
1412
"net/url"
13+
14+
"github.com/markbates/goth"
15+
"golang.org/x/oauth2"
1516
)
1617

1718
const (
1819
authURL string = "https://www.facebook.com/dialog/oauth"
1920
tokenURL string = "https://graph.facebook.com/oauth/access_token"
20-
endpointProfile string = "https://graph.facebook.com/me?fields=email,first_name,last_name,link,bio,id,name,picture,location"
21+
endpointProfile string = "https://graph.facebook.com/me?fields=email,first_name,last_name,link,about,id,name,picture,location"
2122
)
2223

2324
// New creates a new Facebook provider, and sets up important connection details.
@@ -94,7 +95,7 @@ func userFromReader(reader io.Reader, user *goth.User) error {
9495
u := struct {
9596
ID string `json:"id"`
9697
Email string `json:"email"`
97-
Bio string `json:"bio"`
98+
About string `json:"about"`
9899
Name string `json:"name"`
99100
FirstName string `json:"first_name"`
100101
LastName string `json:"last_name"`
@@ -119,7 +120,7 @@ func userFromReader(reader io.Reader, user *goth.User) error {
119120
user.LastName = u.LastName
120121
user.NickName = u.Name
121122
user.Email = u.Email
122-
user.Description = u.Bio
123+
user.Description = u.About
123124
user.AvatarURL = u.Picture.Data.URL
124125
user.UserID = u.ID
125126
user.Location = u.Location.Name

0 commit comments

Comments
 (0)