@@ -16,7 +16,7 @@ import (
1616
1717const (
1818 requestURL = "https://api.twitter.com/oauth/request_token"
19- authorizeURL = "https://api.twitter.com/oauth/authorize "
19+ authenticateURL = "https://api.twitter.com/oauth/authenticate "
2020 tokenURL = "https://api.twitter.com/oauth/access_token"
2121 endpointProfile = "https://api.twitter.com/1.1/account/verify_credentials.json"
2222)
@@ -32,6 +32,7 @@ type TwitterProvider struct {
3232}
3333
3434type twitterUser struct {
35+ UserName string `json:"screen_name"`
3536 Name string `json:"name"`
3637 AvatarURL string `json:"profile_image_url"`
3738 Email string `json:"email"`
@@ -78,6 +79,7 @@ func (t TwitterProvider) FetchUserData(ctx context.Context, tok *oauth.AccessTok
7879
7980 data := & UserProvidedData {
8081 Metadata : map [string ]string {
82+ userNameKey : u .UserName ,
8183 nameKey : u .Name ,
8284 avatarURLKey : u .AvatarURL ,
8385 },
@@ -107,7 +109,7 @@ func newConsumer(provider *TwitterProvider) *oauth.Consumer {
107109 provider .Secret ,
108110 oauth.ServiceProvider {
109111 RequestTokenUrl : requestURL ,
110- AuthorizeTokenUrl : authorizeURL ,
112+ AuthorizeTokenUrl : authenticateURL ,
111113 AccessTokenUrl : tokenURL ,
112114 })
113115 return c
0 commit comments