diff options
author | Unknown <joe2010xtmf@163.com> | 2014-04-14 05:37:39 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-04-14 05:37:39 -0400 |
commit | a1ab3cad3ea25f561f81c41e0c9e562408ef5c96 (patch) | |
tree | 86ea1796f7df85d0122bf75b734718ba6923dc53 /modules/social | |
parent | 3c3cda7326f11b2bb8a2a57a3bc327285bf6b115 (diff) | |
download | gitea-a1ab3cad3ea25f561f81c41e0c9e562408ef5c96.tar.gz gitea-a1ab3cad3ea25f561f81c41e0c9e562408ef5c96.zip |
Weibo oauth
Diffstat (limited to 'modules/social')
-rw-r--r-- | modules/social/social.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/social/social.go b/modules/social/social.go index 5baa3c8d81..afcafd488e 100644 --- a/modules/social/social.go +++ b/modules/social/social.go @@ -12,7 +12,7 @@ import ( "strconv" "strings" - "code.google.com/p/goauth2/oauth" + oauth "github.com/gogits/oauth2" "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/base" @@ -368,7 +368,7 @@ func (s *SocialWeibo) SetRedirectUrl(url string) { s.Transport.Config.RedirectURL = url } -func (s *SocialWeibo) UserInfo(token *oauth.Token, URL *url.URL) (*BasicUserInfo, error) { +func (s *SocialWeibo) UserInfo(token *oauth.Token, _ *url.URL) (*BasicUserInfo, error) { transport := &oauth.Transport{Token: token} var data struct { Id string `json:"id"` @@ -378,7 +378,7 @@ func (s *SocialWeibo) UserInfo(token *oauth.Token, URL *url.URL) (*BasicUserInfo var urls = url.Values{ "access_token": {token.AccessToken}, - "uid": URL.Query()["uid"], + "uid": {token.Extra["id_token"]}, } reqUrl := "https://api.weibo.com/2/users/show.json" r, err := transport.Client().Get(reqUrl + "?" + urls.Encode()) |