supertokens / supertokens-node

Node SDK for SuperTokens core
https://supertokens.com
Other
278 stars 72 forks source link

Core call caching issue fix for nextjs apps #829

Closed rishabhpoddar closed 2 months ago

rishabhpoddar commented 2 months ago

Summary of change

NextJS caches fetch calls that have GET requests, and as a result, a call to something like getRoles() may not return the most up to date info from the core. So we add the cache: "no-cache" arg when making fetch calls.

Discord link: https://discord.com/channels/603466164219281420/1234854984252788796/1234854984252788796

NextJS link: https://nextjs.org/docs/app/building-your-application/caching#data-cache

Test Plan

Added a test to make sure we are adding the no cache arg

Checklist for important updates