Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API caching not checking for refreshed tokens #24

Open
EricNetsch opened this issue Jul 19, 2017 · 1 comment
Open

API caching not checking for refreshed tokens #24

EricNetsch opened this issue Jul 19, 2017 · 1 comment

Comments

@EricNetsch
Copy link

The proxy caching system is only checking the if there is a cache for the Shopify store. This does not take into account other variables such as whether the access token has been changed. A great example is if the store removes your app access and decides to re-install the app at a later date. The access token would be different and therefore should also be checked during the getChachedAPI function.

I changed the function to also check to see if the cached access token is the same as the config access token.

if (!cached || Shopify._cachedAPIs[shop].access_token !== apiConfig.access_token) { cached = Shopify._cachedAPIs[shop] = new Shopify.API(apiConfig); }

This is an issue I have been dealing with for about a year and finally forked the package and found the fix.

Let me know if you need further explanation on why this should be implemented. Cheers

@froatsnook
Copy link
Owner

years later can you submit a PR? ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants