Web3auth login is not working in react-native

Web3auth
Oops! something went wrong
you many have presseed the back button, refreshed during login, opened too many login dialogs, or there is some issue with cookies, since we couldn’t find your session. Try logging in again from the application and if the problem persists please contact the administrator

This error is happening for google, apple, passwordless login.

@web3auth/react-native-sdk”: “^8.1.0”

This is working on my local perfectly. But other user in other country (and apple review team) faced this issue continuously.

What’s the reason? How to fix?

Hi Chris,

Thanks for reaching out. I understand you’re facing an issue with Web3Auth login not working properly in your React Native application for users in different regions. Let’s try to narrow down the issue:

  1. SDK Version: You’re using @web3auth/react-native-sdk version ^8.1.0.

  2. Issue Description: The error suggests potential issues with sessions or cookies, possibly related to using the back button, refreshing during login, or opening too many dialogs.

  3. Platform: React Native

To assist further, could you please provide:

  • Web3Auth Initialization & Login Code Snippets: This will help us understand how you’ve set up the Web3Auth process.
  • Potential Network/CORS Issues: Since it’s working locally for you but not for others, there might be regional restrictions or network-related issues. You might want to check any regional-specific firewall or network settings.
  • Additional Debugging Information: If possible, can you check if there are any console logs or error messages appearing on the devices of the users experiencing this issue?

For immediate steps, you can look into:

Once you provide the additional information, we can delve deeper. Thank you for your patience!

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours

const chainConfig = {
  chainNamespace: ChainNamespace.EIP155,
  chainId: "0x38",
  rpcTarget: "https://bsc-mainnet.infura.io/v3/INFURA_KEY",
  displayName: "BNB Smart Chain",
  blockExplorerUrl: "https://bscscan.com",
  ticker: "BNB",
  tickerName: "Binance Coin",
  decimals: 18,
  logo: "https://upload.wikimedia.org/wikipedia/commons/f/fc/Binance-coin-bnb-logo.png",
};
  useEffect(() => {
    const init = async () => {

      const web3auth = new Web3Auth(WebBrowser, EncryptedStorage, {
        clientId: WEB3AUTH_CLIENTID,
        redirectUrl,
        network: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
        privateKeyProvider,
      });

      setWeb3auth(web3auth);

      await web3auth.init();

      if (web3auth.ready) {
        setProvider(web3auth.privateKeyProvider);
        setLoggedIn(true);
      }
    };
    init();
    
  }, []);
      await web3auth.login({
        loginProvider: LOGIN_PROVIDER.APPLE,
        redirectUrl,
        mfaLevel: "none"
      });

Hey @chrisiancuya

Have you tried logging in yourself in a production build? Is there any way you can reproduce this? Additionally, can you let us know the location of the apple review team? Finally, if they can give us some logs of the error it would be helpful. Since we are not able to reproduce this ourselves, it is difficult for us to understand where this is going wrong.

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