You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now the token expiry time is only sotred in the backend(redis), when the page is operated again after a long time without operation, the page will have a request 401 error first and then jump to the login page, the better solution should be to store a token expiry time in the frontend and check if token is expired when we call api(need auth) and turn to login page if token is expired.
there are two options:
change to use cookie save token, the benefit is that the cookie comes with an expiration time, the downside is that some of the code needs to be rewritten.
add a timestamp for token use localStorage, the benefit is don't need rewrite code, the downside is we need to maintain the expiry time manually.
The text was updated successfully, but these errors were encountered:
Now the token expiry time is only sotred in the backend(redis), when the page is operated again after a long time without operation, the page will have a request 401 error first and then jump to the login page, the better solution should be to store a token expiry time in the frontend and check if token is expired when we call api(need auth) and turn to login page if token is expired.
there are two options:
The text was updated successfully, but these errors were encountered: