Authentication is lost after page refresh even with custom domain


i recently started using Auth0 for my new project with Angular. As many others i stumbled over the refesh problem and found this FAQ: Why is authentication lost after refreshing my single page application?

In there using a custom domain is stated as a solution. However i still get this problem in some Browsers (e.g. Firefox). So even if im using a custom domain, the authentification is lost after a refresh.

Is this because im on localhost (atm for development) and my custom domain is something else ( so this would go away in production? I would love to not be forced to use the local storage.

Best regards.

Hi there @maiksfd ,

Does the problem happen only when you test your auth flow in a browser under restricted third-party cookies?

If yes, then

would be correct.

For the time being, when you’re developing on localhost, you can consider creating a new alias for your machine under /etc/hosts by mapping it to your custom domain like this: domain.

This change implies that you have to:

  1. Run your application now by calling http://domain:port;
  2. In your application codebase, find and replace “localhost” with a new alias;
  3. In your Auth0 tenant → Applications → this app → Settings: replace “localhost” with a new alias where relevant.

Does this help? :slight_smile:

1 Like

Hey @marcelina.barycka,

thank you for the quick response.

I found the exact option in the firefox settings (block cookies for cross-page activity tracking) that causes the problem.

For now i added the alias for my machine and it works like a charm.

Thank you very much :slight_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.