I’m using auth0 universal login with nextjs-auth0 SDK to manage authentication in my app.
If a User object has its information updated whilst the user is already logged in, that information will remain stale and the getSession method from the SDK will not update it.
To fix this, I call the ‘/userinfo’ endpoint as an workaround to get the user refreshed data, but sometimes I’m getting rate-limited. ( I do this in the middleware of my app - code below )
I’ve deployed my app on CF pages, and there’s some issues while using that and fetch API cache for data management, so I have implemented caching with an timeout of 30 seconds as can be seen here: