Skip to content

Commit

Permalink
squelch 404 for expired/non-existant tokens when deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
phenry-db authored and nfx committed Aug 31, 2021
1 parent 714ceea commit 42193d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion identity/resource_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ func (a TokensAPI) Read(tokenID string) (TokenInfo, error) {

// Delete will delete the token given a token id
func (a TokensAPI) Delete(tokenID string) error {
return a.client.Post(a.context, "/token/delete", map[string]string{
err := a.client.Post(a.context, "/token/delete", map[string]string{
"token_id": tokenID,
}, nil)
if common.IsMissing(err) {
return nil
}
return err
}

// ResourceToken refreshes token in case it's expired
Expand Down

0 comments on commit 42193d8

Please sign in to comment.