Skip to content

Commit 9da88aa

Browse files
fix: Remove condition limiting when unauthorized message is written (#245)
1 parent 27156d8 commit 9da88aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (c *client) Mutate(ctx context.Context, mutation interface{}, variables map
3030

3131
err = apiClient.Mutate(ctx, mutation, variables, opts...)
3232

33-
if err != nil && c.session.Type() == session.CredentialsTypeAPIToken && err.Error() == "unauthorized" {
33+
if err != nil && err.Error() == "unauthorized" {
3434
return fmt.Errorf("unauthorized: you can re-login using `spacectl profile login`")
3535
}
3636

@@ -45,7 +45,7 @@ func (c *client) Query(ctx context.Context, query interface{}, variables map[str
4545

4646
err = apiClient.Query(ctx, query, variables, opts...)
4747

48-
if err != nil && c.session.Type() == session.CredentialsTypeAPIToken && err.Error() == "unauthorized" {
48+
if err != nil && err.Error() == "unauthorized" {
4949
return fmt.Errorf("unauthorized: you can re-login using `spacectl profile login`")
5050
}
5151

0 commit comments

Comments
 (0)