Skip to content

Commit

Permalink
use built-in cache dir for default
Browse files Browse the repository at this point in the history
rather than cluttering up HOME
  • Loading branch information
lstoll-sfdc committed Dec 11, 2023
1 parent f0c0031 commit cb7da0c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tokencache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,11 @@ func (e *EncryptedFileCredentialCache) Available() bool {
func (e *EncryptedFileCredentialCache) resolveDir() (string, error) {
dir := e.Dir
if dir == "" {
dir = "~/.oidc-cache"
cacheDir, err := os.UserCacheDir()
if err != nil {
return "", fmt.Errorf("could not find user cache dir: %w", err)
}
dir = path.Join(cacheDir, ".oidc-cache")
}

if strings.HasPrefix(dir, "~/") {
Expand Down

0 comments on commit cb7da0c

Please sign in to comment.