Periodic token re-validation #29
-
I'm implementing a login service based on a third party service that requires apps to validate tokens periodically once every hour while logged in. To cover this, I want to validate every time a user visits a page and an hour has passed, how can I do this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You will have to setup a cronjob to validate every hour, to do this you will also need to store the access token, refresh token and expiration date in the database (it can be in the session if the session data is stored in the database) How to build the cronjob will depend on where you're deploying as it's not the same CF, Vercel, Netlify or a long running process. |
Beta Was this translation helpful? Give feedback.
You will have to setup a cronjob to validate every hour, to do this you will also need to store the access token, refresh token and expiration date in the database (it can be in the session if the session data is stored in the database)
How to build the cronjob will depend on where you're deploying as it's not the same CF, Vercel, Netlify or a long running process.