Skip to content

Commit 5366d9d

Browse files
Ryan Kohlercodyoss
authored andcommitted
google: Make sure time is always in UTC
If times are stored in different time zones, then we occasionally get heisenbugs about expired tokens Change-Id: I0c117977688d8d6c7b12b211092e5040a41a1f46 GitHub-Last-Rev: 3ff51b3 GitHub-Pull-Request: #482 Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/300929 Reviewed-by: Tyler Bui-Palsulich <tbp@google.com> Trust: Tyler Bui-Palsulich <tbp@google.com> Trust: Cody Oss <codyoss@google.com> Run-TryBot: Tyler Bui-Palsulich <tbp@google.com> TryBot-Result: Go Bot <gobot@golang.org>
1 parent 9bb9049 commit 5366d9d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

google/internal/externalaccount/basecredentials.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ import (
1414
)
1515

1616
// now aliases time.Now for testing
17-
var now = time.Now
17+
var now = func() time.Time {
18+
return time.Now().UTC()
19+
}
1820

1921
// Config stores the configuration for fetching tokens with external credentials.
2022
type Config struct {

0 commit comments

Comments
 (0)