Getting error something went wrong

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

  • SDK Version: 6.1.7

  • Platform: React

  • Browser Console Screenshots:

  • Related to Custom Authentication? Please provide the following info too: (Optional)

    • Verifier Name:
    • JWKS Endpoint:
    • Sample idToken(JWT)

Please provide the Web3Auth initialization and login code snippet below:
useEffect(() => {
const init = async () => {
try {
const chainConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: process.env.REACT_APP_CHAIN_ID as string,
rpcTarget:
process.env.REACT_APP_PROVIDER_URL ?? “https://rpc.ankr.com/eth”,
displayName: “Ethereum Mainnet”,
blockExplorer: “https://goerli.etherscan.io”,
ticker: “ETH”,
tickerName: “Ethereum”,
};
const web3auth = new Web3AuthNoModal({
clientId: process.env.REACT_APP_CLIENT_ID as string,
chainConfig,
web3AuthNetwork:
(process.env.REACT_APP_NETWORK as OPENLOGIN_NETWORK_TYPE) ?? “cyan”,
});

    const privateKeyProvider = new EthereumPrivateKeyProvider({
      config: { chainConfig },
    });

    const openloginAdapter = new OpenloginAdapter({
      adapterSettings: {
        whiteLabel: {
          name: "W3A Heroes",
          url: "https://web3auth.io",
          logoLight: "https://web3auth.io/images/w3a-L-Favicon-1.svg",
          logoDark: "https://web3auth.io/images/w3a-D-Favicon-1.svg",
          defaultLanguage: "en", // en, de, ja, ko, zh, es, fr, pt, nl
          dark: false, // whether to enable dark mode. defaultValue: false
          theme: {
            primary: "#00D1B2",
          },
        },
        mfaSettings: {
          deviceShareFactor: {
            enable: true,
            priority: 1,
            mandatory: true,
          },
          backUpShareFactor: {
            enable: true,
            priority: 2,
            mandatory: false,
          },
          socialBackupFactor: {
            enable: true,
            priority: 3,
            mandatory: false,
          },
          passwordFactor: {
            enable: true,
            priority: 4,
            mandatory: false,
          },
        },
      },
      loginSettings: {
        mfaLevel: "optional",
      },
      privateKeyProvider,
    });
    web3auth.configureAdapter(openloginAdapter);
    setWeb3auth(web3auth);

    await web3auth.init();
    setProvider(web3auth.provider);
    console.log("web3auth.connected", web3auth.connected);

    if (web3auth.connected) {
      await logout();
      // window.location.reload();
    }
  } catch (error) {
    console.error(error);
  }
};

init();

}, []);

const loginWithEmail = async () => {
try {
if (!web3auth) {
uiConsole(“web3auth not initialized yet”);
return false;
}
console.log(“Here…”);
if (WALLET_ADAPTERS) {
const web3authProvider = await web3auth.connectTo(
WALLET_ADAPTERS.OPENLOGIN,
{
loginProvider: “email_passwordless”,
extraLoginOptions: {
login_hint: email,
},
}
);
console.log(“Here222…”, email);
console.log(“web3 auth”, web3authProvider);
setProvider(web3authProvider);
if (web3authProvider)
try {
let address = await getAccountsByEther(web3auth?.provider);
setKeyInfo({ publicKey: address, privateKey: “” });
} catch (error) {
await logout();
return false;
}
await getUserInfo();
setLoggedIn(true);
return true;
}
} catch (Err) {
console.log(“err”, Err);
toast.error(
“Wallet is not ready yet, Please try after sometime or try refreshing page”
);
await logout();
return false;
}
};

@neha.decrypt Thanks for reaching out.

I see you are using Brave browser which could cause issues.

Please disable Brave shield completely for auth.openlogin.com https://support.brave.com/hc/en-us/articles/360023646212-How-do-I-configure-global-and-site-specific-Shields-settings-

You will need to disable Brave shields for each individual URL such as dashboard.web3auth.io, app.openlogin.com that and other URL you are redirected to.

The reason for this is Web3Auth does not store cookies, but our 3rd-party login providers do. For example, Google login stores a cookie in your browser for authentication purposes. The same applies to other providers.

Alternatively, you could just use Google Chrome which should resolve the issue.

@vjgee No its not due to brave shield, I have turned it off and still getting same error, even on chrome this error occurs. I am able to get the scenerio when this is happening. When it show popup with otp, if I close it multiple times, it stops working with the client id that is being used. I don’t know how to get rid of it

Can you please share the console logs from the page to better understand the error you are facing?