Web3auth Authentication using React moralis in self hosted server

i want to authenticate web3auth using react moralis but it’s not working
here is my code

const handleAuth = async (provider: ‘metamask’ | ‘walletconnect’ | ‘magicLink’ | ‘web3Auth’ = ‘metamask’) => {

try {

  setAuthError(null);

  setIsAuthenticating(true);

  // Enable web3 to get user address and chain

  await enableWeb3({ throwOnError: true, provider });

  const { account, chainId } = Moralis;

  if (!account) {

    throw new Error('Connecting to chain failed, as no connected account was found');

  }

  if (!chainId) {

    throw new Error('Connecting to chain failed, as no connected chain was found');

  }

  // Get message to sign from the auth api

  const { message } = await Moralis.Cloud.run('requestMessage', {

    address: account,

    chain: parseInt(chainId, 16),

    networkType: 'evm',

  });

  // Authenticate and login via parse

  await authenticate({

    signingMessage: message,

    throwOnError: true,

    clientId: "BCl7lfrORJxp_fBvPA08AF3_w4th0uHpKBLMB9t1uA8Inba3SP1xpQ1uGO18Q4RnQRgCzVo9u11M2qPpMOZ5Z5Q",

  });

  onClose();

} catch (error) {

  setAuthError(error);

} finally {

  setIsAuthenticating(false);

}

};

at what line does it stop working?

the code worked with a moralis server before?

no the code does not work with moralis server, actually i want to know how we can give multiple wallet authentication
i have my selfhosted server , so could you please help me out with code
is there any issue in code that have done

what do you mean with this part?

you can use this type of authentication with moralis v2

Actually i want to it with react moralis so that on click their should be popup of different wallet authenticate

You need to add your clientId to your enableWeb3 like you have done with authenticate:

await enableWeb3({
        throwOnError: true,
        provider,
        clientId: '',
});

You also need to add the provider to authenticate:

await authenticate({
        signingMessage: message,
        throwOnError: true,
        provider,
        clientId: '',
});

You can use this demo - it has a popup/modal for different authentication options the user can choose from (MetaMask, WalletConnect, MagicLink, Web3Auth).

I also want to use Web3Auth or MagicLink with self-hosted parse server but facing problems with that.
Is there a guide for this?