Skip to content

Commit

Permalink
fix: Remove condition limiting when unauthorized message is written
Browse files Browse the repository at this point in the history
  • Loading branch information
0michalsokolowski0 committed Aug 28, 2024
1 parent 27156d8 commit 4574288
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`")
}

Expand All @@ -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`")
}

Expand Down

0 comments on commit 4574288

Please sign in to comment.