From 6d0d1c11e87394b987e0b516eab66bcfaf1b8ae9 Mon Sep 17 00:00:00 2001 From: Evan Date: Wed, 26 Jun 2019 22:02:43 +0800 Subject: [PATCH] update --- .gitignore | 1 + .../kkdai/line-social-sdk-go/response.go | 20 +++++++++++-------- .../kkdai/line-social-sdk-go/social.go | 2 +- vendor/vendor.json | 6 +++--- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 17fe3d7..c1fe47a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /line-login-go .DS_Store +vendor/github.com/kkdai/line-social-sdk-go/secret.txt diff --git a/vendor/github.com/kkdai/line-social-sdk-go/response.go b/vendor/github.com/kkdai/line-social-sdk-go/response.go index 356fe75..dac4c97 100644 --- a/vendor/github.com/kkdai/line-social-sdk-go/response.go +++ b/vendor/github.com/kkdai/line-social-sdk-go/response.go @@ -34,14 +34,17 @@ type UserProfileResponse struct { } type Payload struct { - Iss string `json:"iss"` - Sub string `json:"sub"` - Aud string `json:"aud"` - Exp int `json:"exp"` - Iat int `json:"iat"` - Nonce string `json:"nonce"` - Name string `json:"name"` - Picture string `json:"picture"` + Iss string `json:"iss"` + Sub string `json:"sub"` + Aud string `json:"aud"` + Exp int `json:"exp"` + Iat int `json:"iat"` + AuthTime int `json:"auth_time"` + Nonce string `json:"nonce"` + Amr []string `json:"amr"` + Name string `json:"name"` + Picture string `json:"picture"` + Email string `json:"email"` } // Token verification reponse @@ -120,6 +123,7 @@ type TokenResponse struct { TokenType string `json:"token_type"` } +//DecodePayload : decode payload result. func (t TokenResponse) DecodePayload(channelID string) (*Payload, error) { splitToken := strings.Split(t.IDToken, ".") if len(splitToken) < 3 { diff --git a/vendor/github.com/kkdai/line-social-sdk-go/social.go b/vendor/github.com/kkdai/line-social-sdk-go/social.go index 94168ce..21aa4da 100644 --- a/vendor/github.com/kkdai/line-social-sdk-go/social.go +++ b/vendor/github.com/kkdai/line-social-sdk-go/social.go @@ -194,7 +194,7 @@ func (call *RevokeTokenCall) Do() (*BasicResponse, error) { data.Set("client_id", call.c.channelID) data.Set("client_secret", call.c.channelSecret) - res, err := call.c.post(call.ctx, APIEndpointToken, strings.NewReader(data.Encode())) + res, err := call.c.post(call.ctx, APIEndpointRevokeToken, strings.NewReader(data.Encode())) if res != nil && res.Body != nil { defer res.Body.Close() } diff --git a/vendor/vendor.json b/vendor/vendor.json index 64b7545..9515171 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -3,10 +3,10 @@ "ignore": "test", "package": [ { - "checksumSHA1": "ShOC5ldM8dkmc8ibYqKvqa6xLQ4=", + "checksumSHA1": "BEAehNswQ9xLsBXbJZY6BR8zzRM=", "path": "github.com/kkdai/line-social-sdk-go", - "revision": "628ace0ccfe81072003f337e9544544c27dfab30", - "revisionTime": "2019-03-20T02:15:01Z" + "revision": "af8a7d3d99c63cf80e21b0eccc3fb6436bb1558e", + "revisionTime": "2019-06-26T13:55:37Z" }, { "checksumSHA1": "+AFpii7IfZSiqfUIddwXuniOuoo=",