I have integrated auth0 in my react app with the following tutorial https://auth0.com/docs/quickstart/spa/react/01-login
Locally in develop mode everything works fine. However when running the app with a production build I am expierencing a 6/7 second delay after the redirect from auth0 to my app.
Ive used the Chrome devtools JS profiler to debug this and got the following result:
The first 2 seconds it starts loading the page, after that it is idle for 5 seconds and then suddenly the app starts working.
This is the code that is called after the app starts working again:
It is all compiled js, so it is hard to say what it is doing but it looks like it is doing something with a storage event listener.
I would like to know where the delay comes from and if the time can be reduced.