When asking for help in this category, please make sure to provide the following details:
- SDK Version:
"@web3auth/no-modal": "7.0.4"
"@web3auth/openlogin-adapter": "7.0.4"
- Platform: ?
- Browser Console Screenshots: ?
Also, kindly provide the Web3Auth initialization and login code snippet below. This will help us better understand your issue and provide you with the necessary assistance.
const login: IWeb3AuthContext['login'] = useCallback(
async (loginProvider, jwtToken, redirectUrl = '/') => {
setIsLoading(true)
try {
if (!web3auth) {
throw new Error('web3auth not initialized yet')
}
await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
relogin: true,
loginProvider,
extraLoginOptions: {
id_token: jwtToken,
domain: process.env.NEXT_PUBLIC_APP_URL
},
redirectUrl
})
} catch (err) {
console.error('web3auth.connectTo error', err)
throw err
} finally {
setIsLoading(false)
}
},
[web3auth]
)
Description
In the situation: We are fixing bug which if user closes window while logging into Web3Auth, our login process continues and Auth0’s login will be true.
This make user’s state, Auth0 is registered, but Web3Auth is not registered and thus it means we cannot use user’s wallet address in our backend.
So, how do we attempt user to login?
We are currently using Web3AuthNoModal.connectTo()
to login, but it is provided by Context.Provider
, that means we cannot get jwtToken manually…