Multiple Account issue with one twitter account login

When asking for help in this category, please make sure to provide the following details:

"@web3auth/base": "^7.2.1",
"@web3auth/ethereum-provider": "^7.2.1",
"@web3auth/no-modal": "^7.2.1",
"@web3auth/openlogin-adapter": "^7.2.1",
"@web3auth/web3auth-wagmi-connector": "^5.0.1",
  • Verifier Name:
  • JWKS Endpoint:
  • Sample idToken (JWT):

Hi, there, I believe something is wrong with my account. We use web3auth/no-modal plugin with firebase.
Everything was fine, but we wanted to migrate to Core Kit

So I tried to migrate to Core kit, and things didn’t go well.

So I reverted it, however, this multiple account issue happened after that.
If I sign up after removing browser cache, i always got a new account(wallet address), with this error, there are many accounts associated with me in our database.

Can you please investigate this asap?
Thanks!

hi @nolanit229

I’m going to touch base with our team to make sure I can give you a detailed and precise response. Your understanding during this time is greatly appreciated, and I’ll make sure to get back to you with more information as quickly as possible. Thank you for your patience.

Hi, can you please give me any updates?

Hi @nolanit229,

Understanding your situation can indeed be complex, and I want to provide you with a specific answer. Have you had a chance to go through our migration documentation? It might help clarify the transition process you’re going through. You can find it here: Different Private Keys/ Wallet Address across Integrations | Documentation | Web3Auth. Let me know if you need further assistance!

Hello @nolanit229,

I apologize for the inconvenience you’re experiencing. It seems you might not be using the latest version of our SDKs. I strongly recommend upgrading to the latest version, v8.3.0, which has all the latest features and bug fixes…

Regarding the migration to CoreKit that didn’t go as planned, the issue may be related to specific parameters such as useCoreKitKey still being set to true, which could result in discrepancies like a different wallet address. To assist you more effectively, could you please share the relevant web3Auth code snippets? This will allow me to review the setup and offer more targeted help.

Thank you for your cooperation, and I look forward to helping you resolve this issue.

No problem, @maharshi So just giving your more context, I tried to migrate to CoreKit, but because i had some issues with existing wagmi provider, i had to roll back it, and now we’re still using no modal PnP, and i’m the only one account having that issue now.

Thank you for providing more context, @nolanit229. To assist you further, could you please share the code snippets involving web3auth? This will help me understand exactly how you’ve integrated it, and I can provide more specific guidance on resolving the issue.

Awesome, thanks, can i share this via DM? How can I open a DM with you?

Hello, can I open a DM? @maharshi

Sure, @nolanit229. DM me over here on my profile. I’ll be happy to assist you.

@maharshi I couldn’t find DM option, here is some core files

import { WEB3AUTH_CLIENT_ID } from '@/config/env';
import { CHAIN_NAMESPACES } from '@web3auth/base';
import { EthereumPrivateKeyProvider } from '@web3auth/ethereum-provider';
import { Web3AuthNoModal } from '@web3auth/no-modal';
import {
  LOGIN_PROVIDER,
  OPENLOGIN_NETWORK,
  OpenloginAdapter,
} from '@web3auth/openlogin-adapter';
import { Web3AuthConnector } from '@web3auth/web3auth-wagmi-connector';
import { Chain } from 'wagmi';

export const getWeb3AuthConnectorInstance = (
  chains: Chain[],
  idToken: string,
) => {
  const clientId = WEB3AUTH_CLIENT_ID || '';
  // Create Web3Auth Instance
  const chainConfig = {
    chainNamespace: CHAIN_NAMESPACES.EIP155,
    chainId: '0x' + chains[0].id.toString(16),
    rpcTarget: chains[0].rpcUrls.default.http[0], // This is the public RPC we have added, please pass on your own endpoint while creating an app
    displayName: chains[0].name,
    tickerName: chains[0].nativeCurrency?.name,
    ticker: chains[0].nativeCurrency?.symbol,
    blockExplorer: chains[0].blockExplorers?.default.url[0] as string,
  };

  const web3AuthInstance = new Web3AuthNoModal({
    clientId,
    chainConfig,
    web3AuthNetwork: OPENLOGIN_NETWORK.SAPPHIRE_DEVNET,
  });

  const privateKeyProvider = new EthereumPrivateKeyProvider({
    config: { chainConfig },
  });

  // Add openlogin adapter for customisations
  const openloginAdapterInstance = new OpenloginAdapter({
    privateKeyProvider,
    loginSettings: {
      mfaLevel: 'optional',
    },
    adapterSettings: {
      uxMode: 'redirect',
      redirectUrl: window.location.origin,
      loginConfig: {
        // Firebase
        jwt: {
          verifier: 'our-firebase-twitter',
          typeOfLogin: 'jwt',
          clientId,
        },
      },
      whiteLabel: {
        appName: 'OUR',
        appUrl: 'https://abc.xyz',
        defaultLanguage: 'en',
        logoLight:
          'https://pbs.twimg.com/profile_images/1732757244389789696/4z4FrXv2_400x400.jpg',
        logoDark:
          'https://pbs.twimg.com/profile_images/1732757244389789696/4z4FrXv2_400x400.jpg',
        mode: 'auto',
        useLogoLoader: true,
      },
      mfaSettings: {
        // deviceShareFactor: {
        //   enable: true,
        //   priority: 1,
        //   mandatory: true,
        // },
        socialBackupFactor: {
          enable: true,
          priority: 1,
          mandatory: false,
        },
        passwordFactor: {
          enable: true,
          priority: 2,
          mandatory: false,
        },
        backUpShareFactor: {
          enable: true,
          priority: 3,
          mandatory: false,
        },
      },
    },
  });
  web3AuthInstance.configureAdapter(openloginAdapterInstance);

  const connector = new Web3AuthConnector({
    chains: chains,
    options: {
      web3AuthInstance,
      loginParams: {
        loginProvider: LOGIN_PROVIDER.JWT,
        extraLoginOptions: {
          id_token: idToken,
          verifierIdField: 'sub',
        },
      },
    },
  });

  return connector;
};


package.json
{
  "name": "",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint --fix",
    "format": "prettier --write .",
    "prepare": "husky install"
  },
  "engines": {
    "yarn": ">=1.22.17",
    "node": ">=18.18.0",
    "npm": "please-use-yarn"
  },
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^6.5.1",
    "@fortawesome/free-brands-svg-icons": "^6.5.1",
    "@fortawesome/free-regular-svg-icons": "^6.5.1",
    "@fortawesome/free-solid-svg-icons": "^6.5.1",
    "@fortawesome/react-fontawesome": "^0.2.0",
    "@nextui-org/react": "^2.2.9",
    "@react-stately/data": "^3.11.2",
    "@reduxjs/toolkit": "^2.0.1",
    "@tanstack/react-query": "^5.18.0",
    "@tanstack/react-query-devtools": "^5.18.0",
    "@tanstack/react-query-next-experimental": "^5.18.0",
    "@types/luxon": "^3.4.2",
    "@web3-react/core": "^8.2.3",
    "@web3-react/metamask": "^8.2.4",
    "@web3auth/base": "^7.2.1",
    "@web3auth/ethereum-provider": "^7.2.1",
    "@web3auth/no-modal": "^7.2.1",
    "@web3auth/openlogin-adapter": "^7.2.1",
    "@web3auth/web3auth-wagmi-connector": "^5.0.1",
    "ably": "^2.0.1",
    "ahooks": "^3.7.8",
    "clsx": "^2.1.0",
    "emoji-picker-react": "^4.8.0",
    "ethers": "^6.11.1",
    "firebase": "^10.7.1",
    "firebase-admin": "^12.0.0",
    "framer-motion": "^10.18.0",
    "html5-qrcode": "^2.3.8",
    "luxon": "^3.4.4",
    "next": "14.1.4",
    "qrcode.react": "^3.1.0",
    "react": "^18",
    "react-dom": "^18",
    "react-hot-toast": "^2.4.1",
    "react-infinite-scroll-component": "^6.1.0",
    "react-qr-reader": "^3.0.0-beta-1",
    "react-query-kit": "^3.1.0",
    "react-redux": "^9.1.0",
    "react-use": "^17.4.2",
    "recharts": "^2.11.0",
    "redux": "^5.0.1",
    "redux-persist": "^6.0.0",
    "sharp": "^0.33.2",
    "socket.io-client": "^4.7.5",
    "tailwind-merge": "^2.2.1",
    "tailwind-variants": "^0.1.20",
    "tailwindcss-animate": "^1.0.7",
    "ts-deepmerge": "^7.0.0",
    "twitter-lite": "^1.1.0",
    "type-fest": "^4.10.2",
    "viem": "1.21.4",
    "wagmi": "^1.4.13"
  },
  "devDependencies": {
    "@tanstack/eslint-plugin-query": "^5.18.0",
    "@types/node": "^20",
    "@types/react": "^18",
    "@types/react-dom": "^18",
    "autoprefixer": "^10.4.16",
    "eslint": "^8.56.0",
    "eslint-config-next": "14.0.4",
    "eslint-config-prettier": "^9.1.0",
    "husky": "^8.0.3",
    "lint-staged": "^15.2.0",
    "postcss": "^8.4.32",
    "prettier": "^3.2.1",
    "prettier-plugin-organize-imports": "^3.2.4",
    "prettier-plugin-tailwindcss": "^0.5.11",
    "tailwindcss": "^3.3.0",
    "tailwindcss-gradient": "^1.0.1",
    "tw-colors": "^3.3.1",
    "typescript": "^5.3.3"
  },
  "resolutions": {
    "strip-ansi": "6.0.1",
    "wagmi": "^1.4.13"
  },
  "lint-staged": {
    "src/**/*.{js,ts,jsx,tsx}": [
      "prettier --write",
      "eslint --fix"
    ],
    "*.{json,css}": [
      "prettier --write"
    ]
  }
}

Please help us to get this resolved asap, again what happened is i tried to migrate to core kit, i might do something like resetting account, device factor and etc while i was working, but after that i decided not to migrate so i rolled back the changes, however, the multiple account is created everytime whenever i clear my browser cookies.

Hello, any updates? Please let me know, thanks

Hi, bumping on this @maharshi Can you please give me an update asap?
Thanks

Hey @nolanit229,

Your code looks correct, and it’s puzzling that you’re getting two different accounts. It’s possible that something may have been altered inadvertently during your transition to CoreKit. To help resolve this, I need a couple of things from you:

  1. Sub Field: Please provide the sub field for the account experiencing this issue. You can retrieve this performing a console.log after obtaining the idToken from Firebase.

  2. SDK Update: Ensure you’re using the latest version of Web3Auth, which is v8.3.0. After updating, please check if the problem persists.

Let me know once you’ve made these updates, or if you need further assistance!

  1. Sub Field:
  2. SDK Update: yes tried to upgrade, but the same issue still persists.

@maharshi is it okay to put the Sub Field on public btw?

Thank you for the details, @nolanit229. Since you own both the verifier and the Firebase console it would be fine. However, please remember that sharing your Firebase credentials or similar sensitive information in public could pose security risks.

Regarding the issue at hand, could you provide the two different account addresses you’re encountering for the same login? Since these should be recorded in your database, accessing them shouldn’t be too cumbersome.

Once you provide this information, I’ll promptly escalate the matter internally to fast-track the resolution process.

@maharshi Thanks, that’s why i wanted go over a DM, but couldn’t find that option on your profile, anyway, just deleted it, lmk if you need that again.
So just clarifying that its not 2 accounts, its creating a new wallet every time when i login after i clear browser cache, anyway, here are some accounts created btw

0x045136d6aab13145c93bDed8D7351DB14993EFD8
0x07dbD3eE177f15f153B0d10C1ba8e3d18a793F4D
0x9BBC125cb23BdD1685edeDA91445C6825Ef40704
0x50fB4B87B18D9ca0545f94ec0c9A6384b4C9EFaA
0xAB2245B4F5326CEa4aF5959AFc9d690aDD7431Df
0xC22Fa8B0db8A903547F987a350F1F397B15F9D7A
0x8457e48E60d347FbA46D665eE1295b20825De916
0x8d600f9f6d0E885610f056E9151f0E00F756800f

Hey @nolanit229,

Good job on removing the ‘sub’ value. To further assist you, could you please share a screenshot of the dashboard section that displays the verifier configuration? Specifically, I need to see that the verifier is set as our-firebase-twitter with the verifierId listed as sub. This will help ensure everything is aligned correctly in your setup. It would be helpful if client id for your project is visible.