Torus Wallet Not reconnecting

Hi
I have integrate Torus Wallet According to docs (https://docs.tor.us/). I am facing the issue when i refresh the page it not reconnecting

Please share the below information:

  1. SDK along with version
  2. Platform
  3. Error message along with Console logs
  4. Your implementation code
  5. Dapp URL(if applicable)

Hi @ vjgee

I’m using this NPM “@toruslabs/torus-embed”. I have connected my app with torus login. Its not automatically reconnecting when I refresh the web-app. We have the login module Integrated with the wallet connect in our application, because of this the users need to login each time and connect their wallet which is not feasible for our project flow. Hoping to get a prompt response in this matter.

@patrick @projectmanager

Hi @akashswamy, can you share the code snippet so that I can help you with this?

Hi @maharshi
Here is my code . when I refresh the page torus wallet is not reconnecting automatically. if there is any function for auto connect in torus wallet (like metamask) please do let me know ASAP. Thanks for your support. Hope I can get a prompt response.

export const TorUs = async (type, configchainid) => {
console.log(“type,configchainid”, type, configchainid);
const torus = new Torus();
console.log(“TorusWalletConnect”, torus);
await torus.init({
enableLogging: true,
network: {
host: “https://polygon-mainnet.infura.io/v3/a67347b6179c”, // mandatory
networkName: “Polygon Mainnet”,
chainId: 137,
blockExplorer: “https://polygonscan.com/”,
ticker: ‘MATIC’,
tickerName: ‘MATIC’,

},
showTorusButton: true,
logoDark: Darklogo, // Dark logo for light background
logoLight: Darklogo,
topupHide: false,
featuredBillboardHide: true,
disclaimerHide: true,

});
await torus.login();
if (torus) {
console.log(“torus”, torus);
var web3 = new Web3(torus.provider);
console.log(“torus for Torus”, web3);
const accounts = await web3.eth.getAccounts();
const ChainID = await web3.eth.getChainId();
console.log(“accountssss torus”, accounts, ChainID);
const account = accounts[0].toString().toLowerCase();

localStorage.setItem("Provider", web3)
localStorage.setItem("accountInfo", account)
localStorage.setItem('walletConnectType', type)
var weboe = {
  web3: web3,
  web3auth: torus
}
return weboe

}
}

hi @maharshi

Since there is no-reply from your side.
my user facing the issue

continue to app button is not working

And when i refreash the page tours wallet not reconnecting automatically
i have asked this many time from your side not getting reply properly . this basic functions are not working . i need solution to solve this

@vjgee @maharshi Hi all, are there any reply on this at all? It seems that chrome mobile works fine but chrome desktop is not working and does not redirect. Can someone help ue?

Please share the console logs that might help us to understand the situation you’re facing.

@vjgee @akashswamy
are we able to get into a call to solve this? I would also like to shre some video recording of the console too

@vjgee @maharshi @patrick @projectmanager

import Torus from “@toruslabs/torus-embed”;
this is npm i used

this my package.json npm version
@toruslabs/torus-embed”: “^1.41.3”,
“react-scripts”: “^5.0.1”,
“react”: “^18.1.0”,
“webpack”: “^5.88.2”,
“web3”: “^1.7.4”,

this is my code to login torus wallet

export const TorUs = async (type, configchainid) => {
console.log(“type,configchainid”, type, configchainid);
const torus = new Torus();
console.log(“TorusWalletConnect”, torus);
await torus.init({
enableLogging: true,
network: {
host: “https://polygon-mainnet.infura.io/v3/a6738b5a17514327ae8c9afc47b6179c”, // mandatory
networkName: “Polygon Mainnet”,
chainId: 137, //0x89
blockExplorer: “https://polygonscan.com/”,
ticker: ‘MATIC’,
tickerName: ‘MATIC’,

},
showTorusButton: true,
logoDark: Darklogo, // Dark logo for light background
logoLight: Darklogo,
topupHide: false,
featuredBillboardHide: true,
disclaimerHide: true,

});
await torus.login();
if (torus) {
console.log(“torus”, torus);
var web3 = new Web3(torus.provider);
console.log(“torus for Torus”, web3);
const accounts = await web3.eth.getAccounts();
const ChainID = await web3.eth.getChainId();
console.log(“accountssss torus”, accounts, ChainID);
const account = accounts[0].toString().toLowerCase();

localStorage.setItem("Provider", web3)
localStorage.setItem("accountInfo", account)
localStorage.setItem('walletConnectType', type)
var weboe = {
  web3: web3,
  web3auth: torus
}
return weboe

}
}

when the click continue to app its not working. but sometimes working on chrome,its work fine firefox.

same mail vigneshkumarmrmaticz@gmail.com
it not working on chrome

but is working fine in firefox browser

in Chrome Continue to app button not working




@maharshi @vjgee Reply ASAP

1 Like

Hey @akashswamy,
I see that the version you are using of torus-embed is older. Could you please try upgrading it? because as per the information you just gave, I believe Chrome’s latest update would’ve broken the plugin.

@maharshi @vjgee

When i refresh torus wallet not auto reconnecting. how can i reconnect automatically when i refresh the page