summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-14 05:07:19 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-14 05:07:19 -0400
commit3c3cda7326f11b2bb8a2a57a3bc327285bf6b115 (patch)
tree07d61773af91318adc1974c14695f216c2b0d9a3 /modules
parentc3c2cfebaa5cf482f59a7c25972374cdc7a3fab4 (diff)
downloadgitea-3c3cda7326f11b2bb8a2a57a3bc327285bf6b115.tar.gz
gitea-3c3cda7326f11b2bb8a2a57a3bc327285bf6b115.zip
Weibo oauth
Diffstat (limited to 'modules')
-rw-r--r--modules/social/social.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/social/social.go b/modules/social/social.go
index c2ee541776..5baa3c8d81 100644
--- a/modules/social/social.go
+++ b/modules/social/social.go
@@ -368,7 +368,7 @@ func (s *SocialWeibo) SetRedirectUrl(url string) {
s.Transport.Config.RedirectURL = url
}
-func (s *SocialWeibo) UserInfo(token *oauth.Token, _ *url.URL) (*BasicUserInfo, error) {
+func (s *SocialWeibo) UserInfo(token *oauth.Token, URL *url.URL) (*BasicUserInfo, error) {
transport := &oauth.Transport{Token: token}
var data struct {
Id string `json:"id"`
@@ -376,8 +376,12 @@ func (s *SocialWeibo) UserInfo(token *oauth.Token, _ *url.URL) (*BasicUserInfo,
}
var err error
+ var urls = url.Values{
+ "access_token": {token.AccessToken},
+ "uid": URL.Query()["uid"],
+ }
reqUrl := "https://api.weibo.com/2/users/show.json"
- r, err := transport.Client().Get(reqUrl)
+ r, err := transport.Client().Get(reqUrl + "?" + urls.Encode())
if err != nil {
return nil, err
}