Skip to content

Commit

Permalink
Write the cache directly after removing expired credentials
Browse files Browse the repository at this point in the history
The file would otherwise only get updated when a new token needs to get
cached.
  • Loading branch information
tobias-hashicorp committed Oct 27, 2023
1 parent 8767256 commit e1aa5c4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions auth/tokencache/tokensource.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (source *cachingTokenSource) Token() (*oauth2.Token, error) {

// Garbage collect expired tokens
cachedTokens.removeExpiredTokens()
_ = cachedTokens.write(source.cacheFile)

// Handle the different source types
switch source.sourceType {
Expand Down

0 comments on commit e1aa5c4

Please sign in to comment.