I am using Laravel and Vue. I have Passport set up. I login with user, send API to back-end and get access token back. I store access token into local storage and later on use it in headers when making API calls. I changed expire duration to 1 day.
Now what I am interested into is how to handle expire date? I know that API calls stop working after expire date, but how to know that expire date is past and to delete it from local storage, redirect user back to login? Or should I somehow refresh tokens?
I don't want users getting empty pages as API stops working or have them fill out certain form and not get their data committed.
Laravel authentication "standard"
I am using Laravel and Vue. I have Passport set up. I login with user, send API to back-end and get access token back. I store access token into local storage and later on use it in headers when making API calls. I changed expire duration to 1 day.
Now what I am interested into is how to handle expire date? I know that API calls stop working after expire date, but how to know that expire date is past and to delete it from local storage, redirect user back to login? Or should I somehow refresh tokens?
I don't want users getting empty pages as API stops working or have them fill out certain form and not get their data committed.