From 457428866427593e2ba228e14254a72253f62041 Mon Sep 17 00:00:00 2001 From: Michal Sokolowski <0michalsokolowski0@gmail.com> Date: Wed, 28 Aug 2024 11:53:10 +0200 Subject: [PATCH] fix: Remove condition limiting when unauthorized message is written --- client/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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`") }