I am building a simple application built in Rails that allows the client to connect to a third party api to sync customer data.
The customer inputs their username and password and my application retrieves an OAuth access token which is valid for the current datetime + 24 hours.
My current theory is that I run a cron job every hour to check for tokens that are about to expire within the next hour. If there are any then I request a new token.
I wanted to validate this theory or be advised on any alternative approaches.