I am using the IGDB API. It has recently changed to require OAuth tokens for authorization.
This is the structure of the returned token:
{
"access_token": "prau3ol6mg5glgek8m89ec2s9q5i3i",
"expires_in": 5587808,
"token_type": "bearer"
}
My current method is to store the token in Firestore as a document and run a scheduled script everyday to see if the token is 24 hours or less from expiring. If so, the script would replace the token in the database.
The API calls currently happen directly in the app, without a proxy, and would use the token stored in Firestore.
Am I over complicating this? Are there issues with this method?