How to avoid the "Oops!, something went wrong" page when back button is pressed?

Hi community,

we evaluate Auth0 to add authentication to a Next.js app.

I used/downloaded the example, better said starter app, one gets in the Dashboard → Applications → My App → Quick Start tab. I deployed an unmodified copy of this download here (deployed on Vercel) and here (public GitHub repo).

To reproduce the unwanted behavior, do the following:

  1. Open the app on Vercel: https://my-app-zeta-nine.vercel.app/
  2. Login
  3. Press the back button

I would like to avoid the “Oops…” page and prefere a redirect to the page before pressing the login button or to display the login page again.

Perhaps I could achieve this by manipulating the browser history, but this seems like an ugly and poor solution.

Thanks for any help.

Hi @don-esteban,

This is covered here:

Thanks @dan.woda,

I’m aware of this pages. But they did not help to resolve the issue. Anyhow, I tried the proposed solution again. Let’s start from scratch.

This is the unmodified Next.js app from the Quick Start tab (same as above).

  1. Start at the home page
  2. Log in
  3. Press back button

Now you see an empty page.

I followed the advice and configured a login page in the dashboard. Without the login page, I get the Oooops page (see above). With login page, I get an empty page. I’ll attach the dashboard configuration as a screenshot.

One more observation. If I disable cache in FF and Chrome (macOS) everything works as expected. Enabling the cache reproduces the issue again.

1 Like

With the Application Login URI configured, when you get an empty page, is it the correct URl?

It may be helpful if you record a HAR file of the failure and then record one of the success and send it to me in a DM.

Thank you

Thanks, Dan,

I’m pretty sure it is the correct URL. It’s the login URL, which works just fine. See https://my-app-zeta-nine.vercel.app/

Thinking about the HAR file:

I’m not certain, why You need one. Just visit the app https://my-app-zeta-nine.vercel.app/ with the tools You require. I wound do anything different. The app is a complete reproduction and shows the error. At least on my browsers.

Hi all, could anyone reproduce the unwanted behavior? I have no clue how to proceed. I tested all I could figure out. No, succeed. Perhaps I do something very stupid? It seems no one has the same complaints. But what is going wrong here?