SPA refreshing issue

Hello,

I am facing an issue with my react single page application and so far I did not find any solution.

Every time I refresh a page within my application, it logs out and then logs in again. This takes a few seconds every time and the application stops during that time. Unfortunately this is completely ruining the user experience.

1 solution could be using the localstroage to store the token and avoid this refresh problem but from a security point of vue it is not recommended.

Do you have any suggestions?

Thanks a lot in advance!

Evrard

Hi @evrardts,

Welcome to the Community!

This is likely from a silent authentication, which makes a call to validate the session and issues a new token. You should not persist tokens in the browser, this includes local storage.

How often is your SPA refreshing? Just on the initial load?

Hello Dan,

Thanks a lot for your answer.

I followed this tutorial: https://auth0.com/docs/quickstart/spa/react and everything seems to work fine now.

The refreshing issue was due to a wrong use of the react-router-dom on my end.

So everything in orde.

Thanks a lot.

Evrard

1 Like

Let us know if you have any other questions!

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