Hi, my app Finta is using the new Oauth authentication. Right now, my method is that for every request, check to see if the access token has expired or will expire within the next 10 minutes. If so, request a new access token and then proceed. I'm running into an issue where my app attempts to refresh the user's access token potentially multiple times at the same time. For example, my user might request to see their Airtable bases on the frontend at the same time that a function on the backend performs an action that requires using the user's credentials.
Unfortunately, Airtable revoke's a user's refresh token if it's used more than once 😞.
How are other people solving for this? My initial thought is to just create a cron job that runs every 10 minutes that checks to see if any access tokens are expiring soon. If so, refresh. That way, my main application functions won't collide.