[SOLVED] WalletConnect authentication failed in self hosted server

i am not able authenticate with walletconnect in self hosted server

facing error:
“Access to XMLHttpRequest at ‘https://speedy-nodes-nyc.moralis.io/WalletConnect/bsc/testnet’ from origin ‘http://localhost:3000’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.”

“web3-provider.min.js:22 WebSocket connection to ‘wss://g.bridge.walletconnect.org/?env=browser&host=localhost%3A3000&protocol=wc&version=1’ failed”

Hi @Ayush

This error is from walletconnect sdk as they has depreciated their old v1 sdk version.

You can fix this error by updating to walletconnect v2 version. Please check the readme in this github page and follow the steps to update your code.

Let us know if you have any other issues.

@johnversus after updating the below code @JohnVersus scanner is showing but i am not able to connect
if (!user) {
user = await Moralis.authenticate({
provider: wallet_name,
projectId: ‘0d0f8b6ad7b84c4fd14a0d7ae139bb9f’,
showQrModal: true,
chainId: 0x38, // OPTIONAL
newSession: true, // OPTIONAL
signingMessage: message,
showing this error even scanner is visible:
"web3-provider.min.js:22 WebSocket connection to ‘wss://1.bridge.walletconnect.org/?env=browser&host=localhost%3A3000&protocol=wc&version=1’ failed: "