When asking for help in this category, please make sure to provide the following details:
- SDK Version: 7.1.1
- Platform: MacOS
- Browser Console Screenshots:
Sometimes I cannot get an IdToken after calling connectWeb3AuthProvider.
The logout process is called before logging in, but it may not log out cleanly.
Sometimes “Already connected” was throw. How can 100% logout cleanly?
Logout code:
web3auth.walletAdapters[
"openlogin"
].openloginInstance.logout()
MyLogin Code:
async function connectWeb3AuthProvider(
idToken,
) {
try {
const web3authProvider = await web3auth.connectTo('openlogin', {
loginProvider: "jwt",
extraLoginOptions: {
id_token: idToken,
verifierIdField: "sub",
domain: "http://localhost:8080",
},
})
provider = web3authProvider;
return 'success'
} catch (e) {
if (e.message && e.message.includes("Already connected")) {
return 'Already connected';
}
throw e;
}
}