We recently upgraded our integration to Web3Auth v10 (Modal) and are facing an issue with the redirect flow after OTP/email login.
Previously, in older versions, we used:
const web3Auth = new Web3AuthNoModal({
chainConfig,
clientId: CLIENT_ID,
web3AuthNetwork: "mainnet",
privateKeyProvider,
});
web3Auth.configureAdapter(
new AuthAdapter({
privateKeyProvider,
adapterSettings: {
uxMode: UX_MODE.REDIRECT,
redirectUrl:window.location.origin
},
loginSettings: {
mfaLevel: "none",
},
})
);
Everything worked fine before — the user was redirected back to the same URL after a successful login.
Now, after updating to v10, the OTP modal opens in the same tab (which is good), but the redirect flow breaks — it doesn’t properly return to the redirect URL after login from where we initiate the Web3Auth connection.
We also tried explicitly setting redirectUrl in both the Web3AuthOptions and in the connectTo() method, but it still doesn’t redirect correctly.
Updated version (v10):
const web3auth = new Web3Auth({
clientId: process.env.NEXT_PUBLIC_WEB3AUTH_CLIENT_ID,
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
uiConfig: {
uxMode: "redirect",
},
});
We also tried passing the redirect URL dynamically during login:
await web3auth.login({
loginProvider: "email_passwordless",
extraLoginOptions: { login_hint: email },
redirectUrl: window.location.origin,
});
But the redirect still doesn’t happen correctly — the URL we use to log in with Web3Auth doesn’t redirect back to the same URL after the OTP step.
Package details:
"@web3auth/auth": "^10.6.0",
"@web3auth/base": "^9.7.0",
"@web3auth/base-provider": "^9.7.0",
"@web3auth/modal": "^10.6.0",
"@web3auth/no-modal": "^10.6.0"
We’d really appreciate guidance on how to properly handle redirectUrl in v10 — does it need to be configured differently now or explicitly set in the dashboard?