kriasoft / web-auth-library

Authentication library for the browser environment using Web Crypto API
https://developer.mozilla.org/docs/Web/API/Web_Crypto_API
MIT License
103 stars 9 forks source link

Does this lib store the access tokens in some kind of cache or retrieve it each request? #30

Open TowhidKashem opened 2 months ago

TowhidKashem commented 2 months ago

Normally when I need to get a service level access token from Google I need to make a request to google to swap the JWT with an access token. I usually store this in something like workers KV and since the token expires every hour I only need to hit this endpoint once every hour and the rest of the time I use the one in the KV cache.

This lib doesn't accept a way to pass in a KV binding which makes me wonder, is it making the external request for every single request by every user?