Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 71e6027

Browse files
committedOct 20, 2024·
x/oauth2: clarify that ExpiresIn is not automatically populated by the package
Added a note to the `ExpiresIn` field documentation to clarify that the oauth2 package does not automatically populate the `ExpiresIn` field, even if the server returns an "expires_in" value. This change helps prevent confusion for developers expecting ExpiresIn` to be set when interacting with methods like `Config.Exchange`.
1 parent 3e64809 commit 71e6027

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎token.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ type Token struct {
5454
// relative to an unknown time base approximately around "now".
5555
// It is the application's responsibility to populate
5656
// `Expiry` from `ExpiresIn` when required.
57+
// Note: The oauth2 package does not automatically populate
58+
// `ExpiresIn` even if the server returns an "expires_in" field.
5759
ExpiresIn int64 `json:"expires_in,omitempty"`
5860

5961
// raw optionally contains extra metadata from the server

0 commit comments

Comments
 (0)
Please sign in to comment.