Hi
We’re experiencing a weird issue on our development & staging environment.
On our localhost, everything works fine, running via ng serve
.
On our dev & staging environment, it also works, once. If the user hits refresh, or otherwise closes the tab and opens it again, it will not work.
We followed the implementation guide for SPA when setting up, and seems to have narrowed the issue down to this code:
if (!this.auth0Client) {
this.auth0Client = await createAuth0Client(this.config);
}
On our localhost deployment, this resolves almost instantly, while on other deployments, never resolves, and simply times out, if you have refreshed the page.
The odd thing in all of this, if you leave the page up for a minute or so, it works.
Also, if you clear all your cookies, it will also work again.
Until you refresh. I’ve come to assume the page works after a minute because the cookie expires.
I’m thinking it may be an issue with caching, but otherwise, I have no idea.
I’ve also noticed when you log in on our dev environment, there’s a cookie called a0.spajs.txs
which disappears generally after you hit the callback, I think. On our local deployment that stays.
The auth0.is.authenticated
cookie stays on both local and dev deployments.