-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
The API I'm dealing with does not use refresh tokens, but rather than eliding the expires_in value entirely, it comes back in the response as a JSON null value. The problem is not with this library per se (I've opened a ticket with the API maintainer to complain that they're not following the spec, which will break any compliant library).
The problem I'm getting is that Exchange is returning an error whose Error() is strconv.ParseInt: parsing "": invalid syntax. But looking at the code, this shouldn't be happening:
e := vals.Get("expires_in")
if e == "" {
// TODO(jbd): Facebook's OAuth2 implementation is broken and
// returns expires_in field in expires. Remove the fallback to expires,
// when Facebook fixes their implementation.
e = vals.Get("expires")
}
expires, _ := strconv.Atoi(e)
if expires != 0 {
token.Expiry = time.Now().Add(time.Duration(expires) * time.Second)
}So I shouldn't be getting that error at all - the error from Atoi is ignored, in which case expires should be 0. Am I missing another call to Atoi where the error value is bubbled up?
Metadata
Metadata
Assignees
Labels
No labels