From 363e990cd7073db7265ccecb786df0663bda114b Mon Sep 17 00:00:00 2001 From: "HaiMing.Yin" Date: Mon, 13 Apr 2015 12:13:08 +0800 Subject: [PATCH] twitter: return user with access token secret --- providers/twitter/twitter.go | 1 + user.go | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/providers/twitter/twitter.go b/providers/twitter/twitter.go index 1e4e2a829..bb18f652a 100644 --- a/providers/twitter/twitter.go +++ b/providers/twitter/twitter.go @@ -89,6 +89,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { user.UserID = user.RawData["id_str"].(string) user.Location = user.RawData["location"].(string) user.AccessToken = sess.AccessToken.Token + user.AccessTokenSecret = sess.AccessToken.Secret return user, err } diff --git a/user.go b/user.go index 3ad106bf8..e3bf45ef0 100644 --- a/user.go +++ b/user.go @@ -3,13 +3,14 @@ package goth // User contains the information common amongst most OAuth and OAuth2 providers. // All of the "raw" datafrom the provider can be found in the `RawData` field. type User struct { - RawData map[string]interface{} - Email string - Name string - NickName string - Description string - UserID string - AvatarURL string - Location string - AccessToken string + RawData map[string]interface{} + Email string + Name string + NickName string + Description string + UserID string + AvatarURL string + Location string + AccessToken string + AccessTokenSecret string }