Social login / email login not working on safari

I’m facing an issue on Safari for social login/email login, below the code:

  useEffect(() => {
    const initWeb3Auth = async () => {
      const web3AuthInstance = new Web3Auth({
        web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_DEVNET,
        clientId:
          'BGIxxxxxxx....xxxxxxx1k', // Get your Client ID from the Web3Auth Dashboard
        chainConfig: {
          chainNamespace: CHAIN_NAMESPACES.EIP155,
          chainId: '0x61',
          rpcTarget:
            'https://xxxx.....xxxxxx3/',
        },
        modalZIndex: '99998',
      });

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

    initWeb3Auth();
  }, []);


  const login = async () => {
    try {
      console.log('Attempting to login...');
      const connectResponse = await web3auth.connect();
      const user = await web3auth.getUserInfo();
      setProvider(web3auth.provider);
      const rpc = new RPC(web3auth.provider);
      const address = await rpc.getAccounts();
      setUser({
        ...user,
        address: address,
      });
      setLoggedIn(true);
    } catch (error) {
      console.error('Login failed:', error);
    }
  };

It is showing “verify your google” and then disappears, i can’t see errors cause i’m on mobile. Works fine on browser.

@pietro.ciattaglia Thanks for your recent post.

Are you able to login on other browsers like Google Chrome? If so, you may refer to the below steps for Safari:

  1. Open Settings.
  2. Open the Safari section.
  3. Under the Privacy heading, make sure to uncheck Prevent Cross-Site Tracking

    4.Under the General section, ensure the toggle next to Block Pop-ups is disabled

Please find the steps to get the browser console logs on iOS if you still face any issues:

Ok on chrome mobile it is working, on safari by doing the steps you said is working too. The only problem is that in production i cannot say to all users to do these things, how can i solve?

Thanks for confirming.

MacOS / iOS blocks Popups by default unless the steps I provided are done by the user on their browser. Web3Auth modal allows you to use redirect mode.
you can set it using uxMode: 'redirect' instead of pop-up mode.

Please refer to the documentation above and if you need, here is the example using the same.

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