diff options
author | Antoine GIRARD <sapk@users.noreply.github.com> | 2019-08-28 08:55:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-28 08:55:22 +0200 |
commit | 256b1781760beb08ae4bdde3c2750ea21c9c8fc6 (patch) | |
tree | 3ceb7ed14cdab8a1b8fbf169bebce1478af79522 /vendor/golang.org/x/oauth2 | |
parent | e0f95d1545eaf9cc4ebae9df1ff03d3e66d5b251 (diff) | |
download | gitea-256b1781760beb08ae4bdde3c2750ea21c9c8fc6.tar.gz gitea-256b1781760beb08ae4bdde3c2750ea21c9c8fc6.zip |
Update swagger to 0.20.1 (#8010)
* update swagger to 0.20.1
* fiw swagger version for validate
Diffstat (limited to 'vendor/golang.org/x/oauth2')
-rw-r--r-- | vendor/golang.org/x/oauth2/internal/token.go | 10 | ||||
-rw-r--r-- | vendor/golang.org/x/oauth2/oauth2.go | 2 |
2 files changed, 1 insertions, 11 deletions
diff --git a/vendor/golang.org/x/oauth2/internal/token.go b/vendor/golang.org/x/oauth2/internal/token.go index 83f7847e49..355c386961 100644 --- a/vendor/golang.org/x/oauth2/internal/token.go +++ b/vendor/golang.org/x/oauth2/internal/token.go @@ -63,16 +63,12 @@ type tokenJSON struct { TokenType string `json:"token_type"` RefreshToken string `json:"refresh_token"` ExpiresIn expirationTime `json:"expires_in"` // at least PayPal returns string, while most return number - Expires expirationTime `json:"expires"` // broken Facebook spelling of expires_in } func (e *tokenJSON) expiry() (t time.Time) { if v := e.ExpiresIn; v != 0 { return time.Now().Add(time.Duration(v) * time.Second) } - if v := e.Expires; v != 0 { - return time.Now().Add(time.Duration(v) * time.Second) - } return } @@ -264,12 +260,6 @@ func doTokenRoundTrip(ctx context.Context, req *http.Request) (*Token, error) { Raw: vals, } e := vals.Get("expires_in") - if e == "" || e == "null" { - // 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) diff --git a/vendor/golang.org/x/oauth2/oauth2.go b/vendor/golang.org/x/oauth2/oauth2.go index 428283f0b0..291df5c833 100644 --- a/vendor/golang.org/x/oauth2/oauth2.go +++ b/vendor/golang.org/x/oauth2/oauth2.go @@ -117,7 +117,7 @@ var ( // ApprovalForce forces the users to view the consent dialog // and confirm the permissions request at the URL returned // from AuthCodeURL, even if they've already done so. - ApprovalForce AuthCodeOption = SetAuthURLParam("approval_prompt", "force") + ApprovalForce AuthCodeOption = SetAuthURLParam("prompt", "consent") ) // An AuthCodeOption is passed to Config.AuthCodeURL. |