Skip to content

Commit 3e64809

Browse files
andiggopherbot
authored andcommitted
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]>
1 parent 16a9973 commit 3e64809

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

token.go

+7
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ type Token struct {
4949
// mechanisms for that TokenSource will not be used.
5050
Expiry time.Time `json:"expiry,omitempty"`
5151

52+
// ExpiresIn is the OAuth2 wire format "expires_in" field,
53+
// which specifies how many seconds later the token expires,
54+
// relative to an unknown time base approximately around "now".
55+
// It is the application's responsibility to populate
56+
// `Expiry` from `ExpiresIn` when required.
57+
ExpiresIn int64 `json:"expires_in,omitempty"`
58+
5259
// raw optionally contains extra metadata from the server
5360
// when updating a token.
5461
raw interface{}

0 commit comments

Comments
 (0)