We recently migrated to the no modal SDK and are using custom JWT verifier along with google, facebook social logins. After the user logs in (ux mode: redirect), the idToken
is getting set as ""
in the local storage which is blocking our flow to add the web 3 account to backend. And after 2 or 3 logins this might get fixed.
We are facing some similar issue with provider as well, the provider is not available after some users logs in but may become available in the next try. We encountered both issues when the user opting for custom jwt verifier flow.
Also both the issue are not persistent, but is happening intermittently for some users
- SDK Version:
"@web3auth/base": "^5.1.0",
"@web3auth/no-modal": "^5.1.0",
"@web3auth/openlogin-adapter": "^5.1.1",
web3auth code snippet:
useEffect(() => {
const init = async () => {
try {
setIsLoading(true)
const currentChainConfig = CHAIN_CONFIG[currentNetwork]
const web3AuthInstance = new Web3AuthNoModal({
clientId: config.web3AuthKey,
web3AuthNetwork: config.web3AuthNetwork,
chainConfig: {
chainNamespace: currentChainConfig.chainNamespace,
chainId: currentChainConfig.chainId,
rpcTarget: currentChainConfig.rpcTarget,
},
})
const { OpenloginAdapter } = await import('@web3auth/openlogin-adapter')
const adapter = new OpenloginAdapter({
adapterSettings: {
uxMode: 'redirect',
redirectUrl: `${baseURL}/signin`,
replaceUrlOnRedirect: false,
whiteLabel: {
name: 'Platform name',
logoLight: 'image-url',
logoDark: 'image-url',
defaultLanguage: 'en',
// dark: true,
},
loginConfig: {
google: {
name: 'Verifier name,
verifier: 'verifier',
typeOfLogin: 'google',
clientId: config.web3AuthGoogleClientId,
},
facebook: {
name: 'Verifier name,
verifier: 'verifier',
typeOfLogin: 'facebook',
clientId: config.web3AuthFacebookClientId,
},
twitter: {
name: 'Verifier name,
verifier: 'verifier',
typeOfLogin: 'twitter',
clientId: config.web3AuthJwtClientId,
},
jwt: {
name: 'Verifier name,
verifier: 'verifier',
typeOfLogin: 'jwt',
clientId: 'client-id',
},
},
},
})
web3AuthInstance.configureAdapter(adapter)
setWeb3Auth(web3AuthInstance)
await web3AuthInstance.init()
setProvider(web3AuthInstance.provider)
} catch (error) {
console.error(error)
} finally {
setIsLoading(false)
}
}
init()
}, [])
I have removed the verifier names & some information which are related to our platform. But this is basically the whole web3auth setup which is almost similar to what’s there in the integration builder.