GatsbyJS redirect doesn't work after Auth0 login

I have a GatsbyJS site that uses Auth0 for authentication. I have a protected route which “forces” the user to log in before displaying any contents. However, after a successful login, the previous page shows for a short time before redirecting.
I am using “@auth0/auth0-react”: “^1.5.0”.

My code is here GitHub - pbizimis/cp-frontend at develop.

You can try it yourself https://hungry-bhaskara-d15187.netlify.app/.

I made a video of it 2021-06-25 17-48-00_Trim.

I would like to directly redirect to the wanted route and not show that index page.
Thanks!

I have a GatsbyJS site that uses Auth0 for authentication. I have a protected route which “forces” the user to log in before displaying any contents.

MyBalanceNow