laravel-viva-payments icon indicating copy to clipboard operation
laravel-viva-payments copied to clipboard

Authentication Token Persistence

Open UltraWelfare opened this issue 8 months ago • 1 comments

As far as I understand the token is stored in memory

https://github.com/sebdesign/laravel-viva-payments/blob/52796a904fac5783409f876093cdf27b8a99bd99/src/Client.php#L221-L230

Which means that if, for ex; N users do a Viva::orders()->create call -> N authentication calls to Viva would happen. Each request would use a different token.

Shouldn't the authentication call be done once, then refresh when it expires? Probably store it using cache or something equivalent.

UltraWelfare avatar Jun 18 '24 20:06 UltraWelfare