Routing error in Next.js (uxMode is set to redirect)

We had a routing problem in our project, so we tested it on the demo app to see if the same thing happened.

Based on the code implemented by web3auth, only uxMode was set to Redirect.

At this time, if I move the router through the Link component and go back again, routing does not work.

Codes added in the demo app

  • Create Dashboard Page(sample page)
    image

  • Insert Link Component(go to dashboard)

    <Link href="/dashboard">
       Go To Dashboard
    </Link>
    
  • Uxmode is set to redirect

    const openloginAdapter = new OpenloginAdapter({
       privateKeyProvider,
       adapterSettings:{
          uxMode:'redirect'
       }
    });
    

Here’s a video on that issue. ==> *Issue Video


Please provide the following details too when asking for help in this category:

  • SDK Version: v6.1.1 (@web3auth/no-modal)
  • Platform: Web Chrome / Safari

Please provide the Web3Auth initialization and login code snippet below:

1 Like

I faced the same problem in my environment.
(My environment has a slightly older SDK version than the one you reported…)

The following issue describes the problem and the workaround.

We had been seeing this problem for at least 4 months or so.
After investigation, we found that web3auth was closely related to this issue, so we have filed an Issue.

Hi @bjkim, I have raised the issue to the product team. We will get back to you in a while.
Thank you for your input, @s-nakamatsu. I’ll make sure to point them to the issue raised.

Hey @s-nakamatsu, please try the same example out with the latest version of the SDK. let me know if the issue persists for you.

1 Like

I have updated Web3Auth to v6.1.1 and the situation appears to have worsened.

At the time I run web3auth.init(), window.history.state is now null and I get the back button issue even when not logged in.

Of course, the back button problem remains after login as well.

Here is a sample application that I checked.

Hey @s-nakamatsu

Thanks for raising this. We are looking into this issue internally and will try to get back to you with a solution asap.

1 Like

@s-nakamatsu @bjkim Please update to the latest SDK since the nextJS routing issue was fixed with v6.1.6

3 Likes

I confirmed that the issue was fixed with v6.1.6

Thank you for your response!

2 Likes

After I also updated, it works fine.

1 Like