Skip to content

Commit

Permalink
Merge pull request #24 from ericchiang/no_expires
Browse files Browse the repository at this point in the history
oauth2: don't fail if the token response does not expire
  • Loading branch information
ericchiang committed Dec 3, 2015
2 parents 5d3ac76 + d39aff8 commit 562ae81
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions oauth2/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,11 @@ func parseTokenResponse(resp *http.Response) (result TokenResponse, err error) {
if e == "" {
e = vals.Get("expires")
}
result.Expires, err = strconv.Atoi(e)
if err != nil {
return
if e != "" {
result.Expires, err = strconv.Atoi(e)
if err != nil {
return
}
}
} else {
b := make(map[string]interface{})
Expand Down

0 comments on commit 562ae81

Please sign in to comment.