[Archive] Redirect url after login successful

:classical_building: Archived Content from Web3Auth Community

This topic was originally posted by githubdiscussions on 1/18/2023.
This content has been migrated from our previous community forum to preserve valuable discussions.


Hi, I'm trying to make a redirect to the protected page after successfully logging in. The funny thing is that when making the connect, after receiving the jwt in the params, the page refreshes itself, eliminating all the params that I sent in the redirectUrl

I need that after making the openlogin connect, I don't want the "redirectTo" param to be eliminated

const web3AuthInstance = new Web3AuthCore({
          enableLogging: true,
          chainConfig,
          web3AuthNetwork: 'testnet',
          clientId,
        });
        const openloginAdapter = new OpenloginAdapter({
          adapterSettings: {
            uxMode: 'redirect',
            redirectUrl: 'http://localhost:3000/auth/login?redirectTo=/private/route',
            replaceUrlOnRedirect: false
          },
          loginSettings: {
            extraLoginOptions: {
              display: 'page'
            }
          }
        });

package:

  "@web3auth/phantom-adapter": "^4.2.2",
    "@web3auth/torus-solana-adapter": "^4.2.2",
    "@web3auth/base": "^4.2.2",
    "@web3auth/core": "^4.2.2",
    "@web3auth/openlogin-adapter": "^4.2.2",
    "@web3auth/solana-provider": "^4.2.2",


Originally posted by: MarcosGin

Check the discussion at: https://github.com/orgs/Web3Auth/discussions/1222