diff --git a/client/client.go b/client/client.go index ff6f3ba..5660690 100644 --- a/client/client.go +++ b/client/client.go @@ -30,7 +30,7 @@ func (c *client) Mutate(ctx context.Context, mutation interface{}, variables map err = apiClient.Mutate(ctx, mutation, variables, opts...) - if err != nil && c.session.Type() == session.CredentialsTypeAPIToken && err.Error() == "unauthorized" { + if err != nil && err.Error() == "unauthorized" { return fmt.Errorf("unauthorized: you can re-login using `spacectl profile login`") } @@ -45,7 +45,7 @@ func (c *client) Query(ctx context.Context, query interface{}, variables map[str err = apiClient.Query(ctx, query, variables, opts...) - if err != nil && c.session.Type() == session.CredentialsTypeAPIToken && err.Error() == "unauthorized" { + if err != nil && err.Error() == "unauthorized" { return fmt.Errorf("unauthorized: you can re-login using `spacectl profile login`") }