AccelerateNetworks / fusionpbx-webtexting

GNU Affero General Public License v3.0
1 stars 1 forks source link

[FEATURE] Persist data between page loads to efficiently reuse API tokens #39

Open uncheckederror opened 9 months ago

uncheckederror commented 9 months ago

Right now saving the value of an API token to the session in PHP doesn't actually persist that token between page loads. We need to research a solution to this problem.

A call to the login API is made on every send message action executed in WebTexting. Ideally we would hang on to a single token until it expires and then use the refresh token to get a new token.

This issue is a follow up to the work done in #30.

dunkeltron commented 3 months ago

IIRC the reason we get a new auth token every time we send a message is because the field we are using for auth is stored somewhere in fpbx's default settings. This fpbx default setting ([webtexting][accelerate_networks_inbound_token]) is getting populated from fpbx's db upon fpbx login which prevents persistence of new tokens.