Please provide the following details too when asking for help in this category:
So, when I run my code on my local machine with devnet, it works well but when I push to production on vercel, I get an error when I try to login. I use the legacy Cyan Mainnet when on production and I also whitelisted the domain but I still get the error. Can anyone profer any solution please?
SDK Version:
Platform:
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:
Here is my code snippet for initializing web3 here:
const chainConfig = {
chainNamespace: “solana”,
chainId: “0x1”, // Please use 0x1 for Mainnet, 0x2 for Testnet, 0x3 for Devnet
rpcTarget: “https://rpc.ankr.com/solana”,
displayName: “Solana Mainnet”,
blockExplorer: “https://explorer.solana.com”,
ticker: “SOL”,
tickerName: “Solana”,
};
const web3auth = new Web3AuthNoModal({
// For Production
clientId: "BJzzStRTLHjLmRYkzxs2sUVlina3gkhzF4K7I0a3WScwQ7maUDSruzHYWG4nM8OB5B0Jx5mBSzqFCuMlqdQ_ZoY",
// For Development
// clientId: "BNJIzlT_kyic6LCnqAsHyBoaXy0WtCs7ZR3lu6ZTTzHIJGCDtCgDCFpSVMZjxL_Zu4rRsiJjjaGokDeqlGfxoo8", // Get your Client ID from the Web3Auth Dashboard
web3AuthNetwork: "sapphire_mainnet", // Web3Auth Network
chainConfig: chainConfig,
});
There seems to be some bug in the code. Please contact support to fix this.
could not validate redirect, please whitelist your domain: https://demo-skytrades.vercel.app for provided clientId BJzzStRTLHjLmRYkzxs2sUVlina3gkhzF4K7I0a3WScwQ7maUDSruzHYWG4nM8OB5B0Jx5mBSzqFCuMlqdQ_ZoY at https://dashboard.web3auth.io. Also, this project is on sapphire_mainnet network. Please ensure the the used Client ID belongs to this network.
If you have setup your project on the Dashboard with Legacy Cyan Mainnet(USA) , the corresponding parameter should be web3AuthNetwork: "cyan" in your case. The environment on the dashboard should match with the parameter web3AuthNetwork
The available Web3Auth networks are testnet , mainnet , aqua , cyan , sapphire_devnet , and sapphire_mainnet .
Thanks. I think I made some progress with this. However, I encounter another error on logging in:
Failed to connect with openlogin provider Error: Internal JSON-RPC error.
Screenshots of my network tab attached below
That’s awesome, @u.h.ugwu . Going forward I would request you to check if the rpc endpoint used by you is not made unavailable due to a paywall. As you can see here that the mainnet rpc is made exclusive for paid users. You can use the free alternatives, if you choose not to pay for the premium alternatives.