spacectl icon indicating copy to clipboard operation
spacectl copied to clipboard

Stack: local-preview unauthorized suggests re-logging in even with a valid token

Open lexton opened this issue 2 years ago • 1 comments

The situation plays out as so:

  • User has a valid login session
  • User doesn't have write access to a stack

User is presented with an error + suggested fix that doesn't resolve the issue:

unauthorized: you can re-login using `spacectl profile login`

It would be better to say - you don't have access to this resource, or even this resource doesn't exist rather than suggesting to log in again.

lexton avatar Sep 19 '22 19:09 lexton

Good point. Maybe when we're about to display such an error we should make a graphql call akin to "whoami" to see if we have no working session, or whether the session just doesn't have a high enough access level.

cube2222 avatar Sep 20 '22 16:09 cube2222