@Ayush The thing that we solved in meeting is not working when I deployed. Its not connected connected always returning me false even same code is fine on local.
when i tried with popup mode its work fine
Its not giving me error
what is happening even I authorized through google when I land back on application its connection status is still false.
Hey, can you please share the code snippet?
code is exactly the same as your repo
Can you please share your calendar in inbox?
Our repo has the code to be redirected to the same page after login. If you want it to be redirected to a different page, you need to mention that in your redirectUrl within loginSettings of the OpenloginAdapter: Using PnP Web No Modal SDK | Documentation | Web3Auth
Additionally, since after redirection, your page rebuilds, you need to handle the web3auth.connected event within the constructor. This should be similar to what we have done in our examples:
useEffect(() => {
const init = async () => {
try {
await web3auth.init();
// setProvider(web3auth.provider);
console.log("🚀 ~ init ~ web3auth.connected:", web3auth.connected);
if (web3auth.connected) {
await getUserInfo(web3auth);
}
} catch (error) {
console.error(error);
}
};
init();
}, []);
// Login handler
const handleSignUp = async (loginMethod) => {
try {
const web3authProvider = await web3auth.connectTo(
WALLET_ADAPTERS.OPENLOGIN,
{
loginProvider: loginMethod,
}
);
console.log(
"🚀 ~ handleSignUp ~ provider:",
provider,
web3auth.connected
);
if (web3auth.connected) {
await getUserInfo(web3auth);
setProvider(web3authProvider);
}
} catch (error) {
console.log("🚀 ~ handleSignUp ~ error:", error);
}
};
The console web3auth,connected is coming false on deployed URL while on local its comes true when I connect. This is what I am facing. @yashovardhan
Do you guys have any deployed demo of this in redirect mode? because this issue only arising in deployed url.
Yes, we have our playground, which is a multi page app: https://pnp-modal-playground.vercel.app/
Further, you can check our evm modal or no modal single page examples which also have redirect: https://evm-modal-example.vercel.app/
https://evm-no-modal-example.vercel.app/
can you please share this repo as well? no modal one
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.