spacectl
spacectl copied to clipboard
Stack: local-preview unauthorized suggests re-logging in even with a valid token
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.
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.