diff --git a/apiclient/tokens.go b/apiclient/tokens.go index 17935b9..8cd776f 100644 --- a/apiclient/tokens.go +++ b/apiclient/tokens.go @@ -121,7 +121,7 @@ func (c *HTTPclient) CreateToken(token *api.Token) error { log.Errorf("error closing response body: %v", err) } }() - if res.StatusCode != http.StatusCreated && res.StatusCode != http.StatusOK { + if res.StatusCode != http.StatusCreated && res.StatusCode != http.StatusOK && res.StatusCode == http.StatusConflict { return fmt.Errorf("%w: %w", ErrNoStatusOk, fmt.Errorf("%d %s", res.StatusCode, http.StatusText(res.StatusCode))) } return nil