Login to the same email and return different wallet addresses

Two email addresses were returned when logging in to different devices using the same email address

  • email passwordless
  • same client ids
  • no verifiers

address:
0xa0ca180b7d566e88b8e75d789cd3aa3472e306de 0xa78bd16391305f4f6b934df5774a29aeef98272b

@gaoyue945 Welcome Aboard!

Could you share your Dapp URL to check this behavior? Were there any recent changes made? Which ennvironment is this Cyan, Aqua, Sapphire, Testnet, etc?

You may refer to the below documentation for the possible reasons:

Sorry, we dapp can’t share yet,Testnet

You will need to check your code then. Please share the below information to proceed:

  1. Which SDK and version?
  2. Which framework?
  3. Web3Auth Initialization & Login code

@web3auth/base”: “^6.1.7”,
@web3auth/ethereum-provider”: “^6.1.8”,
@web3auth/no-modal”: “^6.1.7”,
@web3auth/openlogin-adapter”: “^6.1.7”,

const loginWithEmail: (email: string) => Promise<string[]> = async (email) => {
if (!window.web3Auth) {
  console.log("web3auth not initialized yet: login");
  init()
  throw new Error('please wait some seconds')
} else {
  try {
    const provider = await window.web3Auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
      loginProvider: "email_passwordless",
      extraLoginOptions: {
        login_hint: email,
      }
    });
    const keys = await getPrivateKey(provider)
    const aAddress = await providerAdapter.initProvider(keys?.[0])
    console.log("Logged in Successfully!");
    const address = await getAccounts()
    return [address, aAddress]
  } catch (error: any) {
    console.log(error, error.code)
    // https://web3auth.io/docs/troubleshooting/sdk-errors-warnings#login-errors
    if (error.code === 5111 && error.message == 'Failed to connect with wallet. Already connected') { // connected
      const address = await getAccounts()
      const keys = await getPrivateKey()
      const aAddress = await providerAdapter.initProvider(keys?.[0])
      return [address, aAddress]
    } else if (error.code === 5003) { // Wallet is not ready yet, Already connecting
      throw new Error('Wallet is not ready yet')
    }
    throw new Error(error?.message)
  }
}
  
}
const web3auth = new Web3AuthNoModal({
clientId,
chainConfig,
web3AuthNetwork: process.env.REACT_APP_NETWORK as any,
sessionTime: Number(process.env.REACT_APP_SESSION_TIME),
enableLogging: false,
});
const privateKeyProvider = new EthereumPrivateKeyProvider({ config: { chainConfig } });
const openloginAdapter = new OpenloginAdapter({
loginSettings: {
  mfaLevel: "none",
},
adapterSettings: {
  whiteLabel: {
    name: "GoMutual",
    logoLight: "https://h5.gomutual.io/logo192.png",
    logoDark: "https://h5.gomutual.io/logo192.png",
    defaultLanguage: "en",
    dark: true, // whether to enable dark mode. defaultValue: false
  },
},
privateKeyProvider,
});
web3auth.configureAdapter(openloginAdapter as any);
console.log('init Web3AuthNoModal', web3auth)

window.web3Auth = web3auth
emitter.emit('web3Auth')

await web3auth.init()

Are you able to upgrade to the latest version V7? :

Is it caused by the old version?

What environment have you setup your project on ? Testnet?

yes. In Testnet . :grinning:

I have forwarded your issue to our dev team and we get back with further updates.

Thank you very much. I would like to add that due to our current internal testing, the data is relatively small. There is only one test email and this problem occurred when logging in on multiple devices.

@gaoyue945 You should upgrade to the latest version V7 to resolve this issue:

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