commit | 3e6480915d39dd1a80fa460e56413857f02cc1b9 | [log] [tgz] |
---|---|---|
author | andig <[email protected]> | Thu Aug 15 19:02:01 2024 +0200 |
committer | Gopher Robot <[email protected]> | Wed Aug 21 18:21:24 2024 +0000 |
tree | cb10610dea00c7544e24754bdc854e3a0e57ce40 | |
parent | 16a9973a41c72ea3e252e9c14be34fcaa2928211 [diff] |
x/oauth2: add Token.ExpiresIn Fixes golang/go#61417 Change-Id: Ib8599f39b4839bf6eed021217350195ad36d1631 Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/605955 Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Mui <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
diff --git a/token.go b/token.go index 5bbb332..109997d 100644 --- a/token.go +++ b/token.go
@@ -49,6 +49,13 @@ // mechanisms for that TokenSource will not be used. Expiry time.Time `json:"expiry,omitempty"` + // ExpiresIn is the OAuth2 wire format "expires_in" field, + // which specifies how many seconds later the token expires, + // relative to an unknown time base approximately around "now". + // It is the application's responsibility to populate + // `Expiry` from `ExpiresIn` when required. + ExpiresIn int64 `json:"expires_in,omitempty"` + // raw optionally contains extra metadata from the server // when updating a token. raw interface{}