Skip to content

Commit 8b43b64

Browse files
authored
fix: add invalid token code to IsValid checker (#19)
fix: add notes to the clear command +semver: feature
1 parent c0c7f38 commit 8b43b64

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

cmd/clear.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ This will forcefully all chromium processes.
2828
If you are on a windows machine and also use chrome as your current/main browser this will also kill those processes.
2929
3030
Use with caution.
31+
32+
If for any reason the local ini file and the secret store on your OS (keyring on GNU, keychain MacOS, windows secret store) are out of sync and the secrets cannot be retrieved by name but still exists,
33+
you might want to use CLI or GUI interface to the secret backing store on your OS and search for a secret prefixed with aws-cli-* and delete manually
3134
`)
3235
RootCmd.AddCommand(ClearCmd)
3336
}

internal/credentialexchange/credentialexchange.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ func IsValid(ctx context.Context, currentCreds *AWSCredentials, reloadBeforeTime
119119
// var oe *smithy.OperationError
120120
var oe smithy.APIError
121121
if errors.As(err, &oe) {
122-
if oe.ErrorCode() == "ExpiredToken" {
122+
if oe.ErrorCode() == "ExpiredToken" || oe.ErrorCode() == "InvalidClientTokenId" {
123+
fmt.Fprintln(os.Stderr, "Stored Credentials invalid or expired")
123124
return false, nil
124125
}
125126
}

0 commit comments

Comments
 (0)