Redirect to /start after connect to google in openlogin

  • SDK Version: 6.1.3
  • Browser Console Screenshots:
const web3Auth = new Web3AuthNoModal({
  clientId: Web3AuthClientId, 
  chainConfig: {
    chainNamespace: "eip155",
    chainId: chain.chainId.toString(16),
    rpcTarget: chain.envParam.privateRpcUrl || "",
    displayName: chain.name,
    blockExplorer: chain.blockExplorerUrl,
    ticker: chain.nativeCurrency.symbol,
    tickerName: chain.nativeCurrency.name,
    decimals: chain.nativeCurrency.decimals,
  },
});
const openloginAdapter = new OpenloginAdapter({
  adapterSettings: {
    uxMode: "redirect",
    loginConfig: {
      google: {
        verifier: GoogleOAuthVerifier,
        typeOfLogin: "google",
        clientId: GoogleOAuthClientId,
      },
    },
  },
  loginSettings: {
        loginProvider: "google",
        redirectUrl: 'http://localhost:3000'
  },
});
web3Auth.configureAdapter(openloginAdapter);
await web3Auth.init();
await web3Auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
  loginProvider: "google",
});

Redirect to /start after connect. Should I handle the /start link or I can customise that?

Hi @david.lau, I would be glad to help you with the redirect to /start, but first things first, I see that you have not added privateKeyProvider to the openLoginAdapter. With V6, for noModal SDKs whenever you initialize the OpenloginAdapter, you need to pass a privateKeyProvider as well. In your case, where the chainNamespace is eip155, you’ll need an EthereumPrivateKeyProvider. I will link an example using EthereumPrivateKeyProvider here.

Thanks @maharshi I have added the etherum private key provider to the config.
I found that the /start issue is caused by the web3authNetwork setting. Currently I am using ‘development’ which will lead to custom server localhost:3000. If I am trying to connect with testnet, how should I continue to set up the environment? I do not see any guides on the documantation

Please use web3authNetwork as testnet
You can follow our quick start here: Quick Start | Documentation | Web3Auth