401 errors in public and private instances

System Information
  • Strapi Version: 4.4.2
  • Operating System: Ubunto 22
  • Database: MySQL 5
  • Node Version: 14.19.3
  • NPM Version: 6.14.17
  • Yarn Version:

Hi we have and app with quasar (vue) and axios with two instances: Public (without token) and private (with token).

Everytime the user starts de app, if the users has logged previusly, and doesn’t close the session, we create and autologin and store again the encrypted token in the store and the Authorization of the axios private instance. The question is we have many 401 errors in the public instance and some 401 in the private instance.

I read in this topic. Axios stores its own cookie for the http request.

My questions are:

How can we refresh the token?.
Can we create and auto refesh lifetime for the token if we can’t refresh it?