I am implementing an authentication system with vuejs on the front and nodejs on the back. When the user logs in a JWT is returned and gets saved on browser's local storage or cookie. Then, I assign a default header with bearer token to all the requests. If I close the tab and open it again, my application looks the local storage and if is a JWT there, it follows the same logic. So until now all good, but what happens if the user closes the application and comes back tomorrow? The same logic will be followed again, but the difference is that my default authentication header will contain an expired JWT and I will get a 401 error. So, the question is, how should I implement an auto login flow because it is bad UX to ask the user for his credentials every time he comes back to my application. Of course I should ask if the last time he visited it was a month ago, but I dont think I should do it every day. One way is to make my JWT expire in one Month but I dont think that is secure enough. Is there any kind of "official" way to implement auto login?