PRODUCTION - could not validate redirect BSCTESTNET

In production i’m getting this error even if i whitelisted the domain. In localhost all is working fine.

REACT CODE:

useEffect(() => {
    const initWeb3Auth = async () => {
      const web3AuthInstance = new Web3Auth({
        clientId:
          'BG4KbPVXXXXX.....XXXXXXXX3l9XlPA',
        chainConfig: {
          chainNamespace: CHAIN_NAMESPACES.EIP155,
          chainId: '0x61',
          rpcTarget:
            'https://XXXXXXXX.bsc-testnet.quiknode.pro/XXXXX/',
        },
        modalZIndex: '99998',
      });

      setWeb3Auth(web3AuthInstance);
      await web3AuthInstance.initModal();
      setProvider(web3AuthInstance.provider);
      setLoggedIn(true);
    };

    initWeb3Auth();
  }, []);

GOT THIS ERROR ONCE I TRY TO LOGIN:
Something went wrong
There seems to be some bug in the code. Please contact support to fix this.
could not validate redirect, please whitelist your domain: https://XXXXXXXXXX.app for provided clientId BGXXXXXXX…XXXXXXlPA at https://dashboard.web3auth.io.
Also, this project is on mainnet network. Please ensure the the used Client ID belongs to this network.

@pietro.ciattaglia Welcome Aboard!

You need to check theweb3AuthNetwork parameter in your code to be same as the environment your project is on. As per the error, the clientId you are using belongs to a project on Mainnet so make sure the same environment matches with the web3AuthNetwork as mainnet

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.