This topic was originally posted by bruno1 on 10/19/2023.
This content has been migrated from our previous community forum to preserve valuable discussions.
I am building on the MPC Core kit SDK. I have set up a custom authenticator and immediately after a successful login to the authenticator, I have taken the returned JWT Token, extracted some information from it and composed an object that implements interface IdTokenLoginParams. I have then passed this object to the loginWithJWT() method. The call to loginWithJWT() has been successful as I can see an increase in the number of login requests in my timeline. How can I now get a public address for the user’s Wallet that has been created on Web3Auth?
useEffect(() => {
if (!provider) {
alert(“Provider not initilaized yet!”);
}
const web3 = new Web3(provider as any);
setWeb3(web3);
}, [provider]);
However, when trying to use it, I get this error:-
Provider not available. Use `.setProvider` or `.provider=` to initialize the provider.
ProviderError: Provider not available. Use `.setProvider` or `.provider=` to initialize the provider.
at Web3RequestManager.<anonymous> (http://localhost:3001/static/js/bundle.js:212749:15)
at Generator.next (<anonymous>)
at http://localhost:3001/static/js/bundle.js:212638:67
at new Promise (<anonymous>)
at __awaiter (http://localhost:3001/static/js/bundle.js:212620:10)
at Web3RequestManager._sendRequest (http://localhost:3001/static/js/bundle.js:212744:12)
at Web3RequestManager.<anonymous> (http://localhost:3001/static/js/bundle.js:212725:35)
at Generator.next (<anonymous>)
at http://localhost:3001/static/js/bundle.js:212638:67
at new Promise (<anonymous>)