prismicio/prismic-cli

[RFC] Ask for login again when token expires

Closed this issue · 0 comments

lihbr commented

Version

  • Prismic CLI version (know it by running prismic --version): 3.8.0-beta.0

Reproduction

  1. Login with the CLI
  2. Let the token expire (with time?)
  3. Attempt a command that requires you to be logged in

What is expected?

It'll be nice for the CLI to understand 401 responses as "your token expired, please login again", ask for credentials then try to perform again the previous request in order to not break the flow.

What is actually happening?

401 responses are thrown:

image

Any additional information

Seems to happen to me more on Windows than on Mac 🤔