CodeIgniter 3 Implement Promise CodeIgniter 3 Implement Promise codeigniter codeigniter

CodeIgniter 3 Implement Promise


You do not need to keep refreshing that login. Create time stamp when You receive login from 3rd party API. Then pass it to back end on each request.

On the back end on each call from front end check time stamp, if it's expired do not do normal calls to API but first get the new login, then do requested calls.

As response to each front end call return also login info, so that front end gets's new credentials after renewal.

If credentials are app wide, then front end does not have to be aware of them at all. Just store credentials in some kind of storage (SQL DB, key value store, etc.), and do auto renewals when appropriate.