# \[Archive\] Issues with Web3Auth Signup - (Sometimes idToken is undefined,Error: Could not get result from torus nodes)

**URL:** <https://builder.metamask.com/t/archive-issues-with-web3auth-signup-sometimes-idtoken-is-undefined-error-could-not-get-result-from-torus-nodes/1780>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [September 14, 2023, 7:15am UTC](https://builder.metamask.com/t/archive-issues-with-web3auth-signup-sometimes-idtoken-is-undefined-error-could-not-get-result-from-torus-nodes/1780 "2023-09-14T07:15:25Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![community2](https://avatars.discourse-cdn.com/v4/letter/c/8baadc/32.png) [@community2](https://builder.metamask.com/u/community2)\
**Post date:** [September 14, 2023, 7:15am UTC](https://builder.metamask.com/t/archive-issues-with-web3auth-signup-sometimes-idtoken-is-undefined-error-could-not-get-result-from-torus-nodes/1780/1 "2023-09-14T07:15:25Z")

</div>

> **🏛 Archived Content from Web3Auth Community**
> 
> This topic was originally posted by **community2** on 9/14/2023.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

**Please provide the following details too when asking for help in this category:**

- SDK Version: @web3auth/modal@6.1.8
- Platform: Website (Nextjs)
- Browser Console Screenshots:  

[![image](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/2X/b/b6faa6b3363e447d4c15796f03aeb37c75cdfc37.png)
image1144×344 10.9 KB
](https://web3auth.io/community/uploads/default/original/2X/a/a2559d1477f7b260b6ee20b22d9e6fffd01119db.png "image")
  

[![image](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/2X/2/2813fe4919d847f19f9a4bb8f1a96aacf7e6966b.png)
image1293×455 107 KB
](https://web3auth.io/community/uploads/default/original/2X/f/f9afeba41dfaa0502571dcd01b7f1487e58c832a.png "image")
  
Just not this, one of the user reported that, he coudn’t sign in first 5 times. And I checked in the backend that the id token was undefined. Then after 10 minutes when he tried again, he was able to sign in.

Could anyone please explain the exact reason, as I need to communicate with my users. Thanks.

**Please provide the Web3Auth initialization and login code snippet below:**

> export const initializeWeb3Auth = async () =\> {  
> try {  
> // console.log(process.env.CLIENT\_ID, " client id ashe na?");  
> const web3auth = new Web3Auth({  
> clientId: process.env.environment== ENVIRONMENT.PROD? process.env.PROD\_CLIENT\_ID: process.env.DEV\_CLIENT\_ID,  
> chainConfig: {  
> chainNamespace: “eip155”,  
> chainId: process.env.environment== ENVIRONMENT.PROD? process.env.PROD\_CHAIN\_ID: process.env.DEV\_CHAIN\_ID,  
> },  
> web3AuthNetwork: “mainnet”,  
> });
> 
> ```
> await web3auth.initModal({
> modalConfig: {
> [WALLET_ADAPTERS.WALLET_CONNECT_V2]: {
> label: "wallet_connect",
> showOnModal: false,
> },
> // Disable Metamask
> [WALLET_ADAPTERS.METAMASK]: {
> label: "metamask",
> showOnModal: false,
> },
> [WALLET_ADAPTERS.TORUS_EVM]: {
> label: "torus",
> showOnModal: false,
> },
> openlogin: {
> label: "openlogin",
> loginMethods: {
> facebook: {
> name: "facebook",
> showOnModal: false,
> },
> reddit: {
> name: "reddit",
> showOnModal: false,
> },
> discord: {
> name: "discord",
> showOnModal: false,
> },
> email_passwordless: {
> name: "email_passwordless",
> showOnModal: false,
> },
> wechat: {
> name: "wechat",
> showOnModal: false,
> },
> weibo: {
> name: "weibo",
> showOnModal: false,
> },
> twitter: {
> name: "twitter",
> showOnModal: false,
> },
> kakao: {
> name: "kakao",
> showOnModal: false,
> },
> line: {
> name: "line",
> showOnModal: false,
> },
> twitch: {
> name: "twitch",
> showOnModal: false,
> },
> apple: {
> name: "apple",
> showOnModal: false,
> },
> github: {
> name: "github",
> showOnModal: false,
> },
> linkedin: {
> name: "linkedin",
> showOnModal: false,
> },
> external_wallet: {
> name: "external_wallet",
> showOnModal: false,
> },
> sms_passwordless: {
> name: "sms_passwordless",
> showOnModal: false,
> },
> },
> },
> },
> });
> console.log(web3auth.connected, " auto 2 connected");
> return web3auth;
> 
> ```
> 
> } catch (err) {  
> console.log(err);  
> }  
> };
> 
> export const connectWeb3Auth = async (dispatch, setWeb3AuthInstance) =\> {  
> console.log(“connect call hocche”);  
> try {  
> const web3auth = await initializeWeb3Auth()  
> if (!web3auth.connected) await web3auth.connect();  
> const user = await web3auth.getUserInfo();
> 
> ```
> const isEmpty = Object.keys(user).length === 0;
> console.log(user, " user", isEmpty);
> 
> ```
> 
> } catch (err) {  
> console.log(“connect error”, err);  
> }  
> };
> 
> // a different code that that connects with the backend  
> const user = await web3authInstance.getUserInfo();  
> console.log(invitation\_details.invitation\_token);  
> await backendSignupApi(  
> dispatch,  
> props.setStatusCode,  
> app\_pub\_key,  
> user.idToken,  
> web3authInstance,  
> invitation\_details.invitation\_token  
> );

---

<div class="post-metadata">

**Author:** ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.com/u/vjgee)\
**Post date:** [September 14, 2023, 7:43am UTC](https://builder.metamask.com/t/archive-issues-with-web3auth-signup-sometimes-idtoken-is-undefined-error-could-not-get-result-from-torus-nodes/1780/2 "2023-09-14T07:43:44Z")

</div>

Can you please share your Dapp URL?

---

<div class="post-metadata">

**Author:** ![community2](https://avatars.discourse-cdn.com/v4/letter/c/8baadc/32.png) [@community2](https://builder.metamask.com/u/community2)\
**Post date:** [September 14, 2023, 10:20am UTC](https://builder.metamask.com/t/archive-issues-with-web3auth-signup-sometimes-idtoken-is-undefined-error-could-not-get-result-from-torus-nodes/1780/3 "2023-09-14T10:20:48Z")

</div>

@vjgee

 ![](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/2X/9/94b583ce6f8181e3eecf5ecb8c4244e45aea55c3.png)

```
  <a href="https://dev.eidverse.io/invited/" target="_blank" rel="noopener nofollow ugc">dev.eidverse.io</a>

```

### [EID Token: Your Award](https://dev.eidverse.io/invited/)

Invited Page (Worked)

---

<div class="post-metadata">

**Author:** ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.com/u/vjgee)\
**Post date:** [September 14, 2023, 6:58pm UTC](https://builder.metamask.com/t/archive-issues-with-web3auth-signup-sometimes-idtoken-is-undefined-error-could-not-get-result-from-torus-nodes/1780/4 "2023-09-14T18:58:22Z")

</div>

@community2 Thanks for your reply.

I was unable to replicate the issue and able to login successfully without any issue with my Google account and received the confirmation email for the waitlist from your Dapp.

You can look at a similar thread [Data ethAddress does not match response address](https://web3auth.io/community/t/data-ethaddress-does-not-match-response-address/5209) which addresses the problem.

---

<div class="post-metadata">

**Author:** ![community2](https://avatars.discourse-cdn.com/v4/letter/c/8baadc/32.png) [@community2](https://builder.metamask.com/u/community2)\
**Post date:** [September 21, 2023, 10:38am UTC](https://builder.metamask.com/t/archive-issues-with-web3auth-signup-sometimes-idtoken-is-undefined-error-could-not-get-result-from-torus-nodes/1780/5 "2023-09-21T10:38:13Z")

</div>

You have been able recreate this as it doesn’t occur all the time. It occurs once in a while for a particular email address. The pattern is undetectable, I feel. If I share the time stamp when the error occurred, would be able to check the logs to detect the root cause?

---

<div class="post-metadata">

**Author:** ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.com/u/vjgee)\
**Post date:** [September 21, 2023, 10:41am UTC](https://builder.metamask.com/t/archive-issues-with-web3auth-signup-sometimes-idtoken-is-undefined-error-could-not-get-result-from-torus-nodes/1780/6 "2023-09-21T10:41:09Z")

</div>

When the error occurs again, please do share the exact timestamp and logs.

---

<div class="post-metadata">

**Author:** ![community2](https://avatars.discourse-cdn.com/v4/letter/c/8baadc/32.png) [@community2](https://builder.metamask.com/u/community2)\
**Post date:** [September 21, 2023, 10:48am UTC](https://builder.metamask.com/t/archive-issues-with-web3auth-signup-sometimes-idtoken-is-undefined-error-could-not-get-result-from-torus-nodes/1780/7 "2023-09-21T10:48:32Z")

</div>

Time stamp - just now - 4:40 PM (GMT+6)  
let me know if you need the client id  
mail - tahmidislam@iut-dhaka.edu  
I could sign in with this email before june. But then since june, this mail gets blocked all the time.

[![image](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/2X/5/502b0224a139e7f9ec2841f96cf46d9e39c69084.png)
image1291×214 44.7 KB
](https://web3auth.io/community/uploads/default/original/2X/9/98c612185ca1be526dfea636297cf9b92e2ce145.png "image")
  

[![image](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/2X/3/33b4d74e33960103035962022bbe78d0c859cdd6.png)
image871×491 145 KB
](https://web3auth.io/community/uploads/default/original/2X/c/c6faa3ff19badef758b866820cb602d5d5e306a7.png "image")

---

<div class="post-metadata">

**Author:** ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.com/u/vjgee)\
**Post date:** [September 21, 2023, 10:51am UTC](https://builder.metamask.com/t/archive-issues-with-web3auth-signup-sometimes-idtoken-is-undefined-error-could-not-get-result-from-torus-nodes/1780/8 "2023-09-21T10:51:09Z")

</div>

This email tahmidislam@iut-dhaka.edu is a Google account? What version of Chrome does the issue occur on?

---

<div class="post-metadata">

**Author:** ![community2](https://avatars.discourse-cdn.com/v4/letter/c/8baadc/32.png) [@community2](https://builder.metamask.com/u/community2)\
**Post date:** [September 21, 2023, 10:58am UTC](https://builder.metamask.com/t/archive-issues-with-web3auth-signup-sometimes-idtoken-is-undefined-error-could-not-get-result-from-torus-nodes/1780/9 "2023-09-21T10:58:31Z")

</div>

yes, it is a google account. It used to work.  
My users are facing two kind of problems while signing up -  
1.The user who complained the first time, his id token was undefined but after 5-6 failed attempt he was able to login.  
2.Another user with an @gmail domain faces the same error this edu email receives

---

<div class="post-metadata">

**Author:** ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.com/u/vjgee)\
**Post date:** [September 21, 2023, 11:07am UTC](https://builder.metamask.com/t/archive-issues-with-web3auth-signup-sometimes-idtoken-is-undefined-error-could-not-get-result-from-torus-nodes/1780/10 "2023-09-21T11:07:48Z")

</div>

Can you explain how are you getting the IDtoken? Which of our examples are you using for your code? Also, share your package.json file

In the meantime, I have reported this to our Dev team to check.

---

<div class="post-metadata">

**Author:** ![community2](https://avatars.discourse-cdn.com/v4/letter/c/8baadc/32.png) [@community2](https://builder.metamask.com/u/community2)\
**Post date:** [September 21, 2023, 12:51pm UTC](https://builder.metamask.com/t/archive-issues-with-web3auth-signup-sometimes-idtoken-is-undefined-error-could-not-get-result-from-torus-nodes/1780/11 "2023-09-21T12:51:32Z")

</div>

After 4/5 failed attempts this idToken issue generally is solved automatically.  
But the issue with unable to login from share From Auth Network is a persistent one

Frontend

```auto
const app_scoped_privkey = await web3authInstance.provider?.request({
        method: "eth_private_key", // use "private_key" for other non-evm chains
      });
      console.log(app_scoped_privkey, " app scoped private key");
      if (typeof app_scoped_privkey === "string") {
const app_pub_key = getPublicCompressed(
          Buffer.from(app_scoped_privkey.padStart(64, "0"), "hex")
        ).toString("hex");
    const user = await web3authInstance.getUserInfo();
    console.log(invitation_details.invitation_token);
    await web3authApi(
      dispatch,
      props.setStatusCode,
      app_pub_key,
      user.idToken,
      web3authInstance,
      invitation_details.invitation_token
    );

```

Backend

```auto
 const jwks = jose.createRemoteJWKSet(
    new URL("https://api.openlogin.com/jwks") 
  );
  console.log("check if idToken is undefined",idToken)
  // Verify the JWT using Web3Auth's JWKS
  const jwtDecoded = await jose.jwtVerify(idToken, jwks, {
    algorithms: ["ES256"],
  });

```

---

<div class="post-metadata">

**Author:** ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.com/u/vjgee)\
**Post date:** [September 22, 2023, 5:08am UTC](https://builder.metamask.com/t/archive-issues-with-web3auth-signup-sometimes-idtoken-is-undefined-error-could-not-get-result-from-torus-nodes/1780/12 "2023-09-22T05:08:47Z")

</div>

Your issue has been forwarded to our team to review and we will get back with further updates once available.

---

<div class="post-metadata">

**Author:** ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.com/u/vjgee)\
**Post date:** [September 22, 2023, 6:16am UTC](https://builder.metamask.com/t/archive-issues-with-web3auth-signup-sometimes-idtoken-is-undefined-error-could-not-get-result-from-torus-nodes/1780/13 "2023-09-22T06:16:25Z")

</div>

Our team reviewed your issue and recommended that since you have only Google login for your Dapp, you should be using PnP Web-Nomodal SDK instead of Modal SDK. You may follow the below guide [https://web3auth.io/docs/content-hub/guides/google](https://web3auth.io/docs/content-hub/guides/google) to help you.
