I have a Single Page Application (SPA) that communicates with an API. I've created a very simple authentication system: user logs in and gets a JSON Web Token (JWT) that's stored on user's local storage.
I also have an endpoint on the API that let's me check if the token is still valid or not.
Should I call this endpoint each time a user navigates to a different page on the SPA or should I only call it when the user wants to access areas of the site that will use the token for requests?