TorusPlugin dissapears

Hello,

In the exemple web3auth modal hence you login the torus widget appears but when you reload the page the widget disappears.

Do you have a way so that it always show ?

Best regards.

@guillaume Could you please update the web3auth SDKs to version 6? For detailed instructions on how to migrate from version 5 to version 6, please refer to the migration guide available at here Additionally, you can find useful examples in the pnp-examples repository.

You can also call initWithProvider on reload:

const userInfo = await web3Auth.getUserInfo()
await torusPlugin.initWithProvider(provider, userInfo);

Hi @vjgee,

Thank you but the access to your link is not working, I have AccessDenied. Could you do something about that ?

I’ve updated the link in the previous comment. Please check.

Thanks the link is working. But It doesn’t answer my initial question.

I am not able to show the torus widget. Can you provide me with the exact code to show it ? Maybe I am missing something…

Regards.

You can call the initWithProvider on reload, code snippet below:

const userInfo = await web3Auth.getUserInfo()
await torusPlugin.initWithProvider(provider, userInfo);

Thank you @vjgee, I can make it appears. But sometime the widget is showing as we need to login ? Do you know why ?

I have the exact same code and in Chrome it appears with the user info and with firefox there is no user in the widget it is a connect to widget like this.

Screenshot 2023-09-13 at 15.39.03

Do you know how I can correct it ?

And how can I ensure that widget is showing Polygon network instead of Ethereum network ?

Is it due to the web3auth instance ? If I am changing account the widget is still loaded with the other account as well…

This is related to Firefox browser so check with them.

Read the documentation and set the chain config accordingly

Hi @vjgee I am not sure It is only due to Firefox because I have the same as well in Chrome sometimes. The widget shows as connect… Do you have an idea ?

I will check with our Dev team and get back when there is an update.

@vjgee Just to be sure. Do I need to do something like that to be connected in the widget:

await web3AuthInstance.value.connectTo(WALLET_ADAPTERS.TORUS_EVM, {
  loginProvider: 'jwt',
  extraLoginOptions: {
    id_token: data.setWeb3AuthToken,
    verifierIdField: 'sub', // sub, email, or custom
  },
})

Or is it automatic hence you log in with open login verifier ? I am using this function to connect with only jwt verifier. I am not using social media connection:

await web3AuthInstance.value.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
  loginProvider: 'jwt',
  extraLoginOptions: {
    id_token: data.setWeb3AuthToken,
    verifierIdField: 'sub', // sub, email, or custom
  },
})

Regards.

@guillaume I think you are handling the TorusPlugin properly. It’s Vue that is not letting it persist through a refresh.
You can checkout our other examples with torusPlugin with react which work fine.

@maharshi Does it means that I could never do it ? Can someone on your side check it out ?

All my stack is in VueJS and I cannot go live without the widget… If there is no widget where can I get the link to the torus wallet to put myself a button.

It is weird that no one ever had the problem so far. VueJS is quite used in blockchain industry

@guillaume I did not mean that you cannot do it with Vue. What I mean to say is that persisting the torus wallet button happens through useEffect in react, you can work on your VueJS implementation to make it persist via its equivalent on VueJS. It’s not an issue on web3Auth’s side.

@maharshi Would you have an example of the VueJS implementation ?

And my concern also is that the widget is persisting it is just that the widget is not connected to the user wallet as shown in the picture above.

Do you know how is it possible ?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.