Can not access wallet address when social login

Our site is ofai.app and we are using web3auth plug n Play modal.
We can successfully integrate web3auth social login in our platform and it does generate wallet address for the user when social login.

And we can get the generated wallet address from the following code.

const solWallet = new SolanaWallet(web3auth.provider);
const accounts = await solWallet.requestAccounts();
const walletAddress = accounts[0]

The problem is sometimes it generates multiple wallet addresses with the same social login + gmail and there’s no way access the wallet address that is automatically generated by social login.

When I try to social login on https://only1.app, I can access the wallet address via torus solana and successfully add the wallet in phantom via private key.

We are using Solana network.

hi @joenry95

Thanks for reporting this issue. Can you share with me the packages and the version that you are using ?

Also can you share some screens, a screen video or how do you realized about this issue ?

versions:

    "@solana/web3.js": "^1.93.0",
    "@wavesurfer/react": "^1.0.4",
    "@web3auth/base": "^8.6.2",
    "@web3auth/default-solana-adapter": "^8.6.2",
    "@web3auth/modal": "^8.6.2",
    "@web3auth/solana-provider": "^8.6.2",
    "@web3auth/wallet-services-plugin": "^8.6.2",

code:

const chainConfig = {
  chainNamespace: CHAIN_NAMESPACES.SOLANA,
  chainId: '0x1',
  rpcTarget: 'https://fluent-aged-putty.solana-mainnet.quiknode.pro/ece7111420081e8ac46a76b2f2a93b2d4dc1367e',
  displayName: 'Solana Mainnet',
  blockExplorerUrl: 'https://explorer.solana.com',
  ticker: 'SOL',
  tickerName: 'SOLANA',
  decimals: 18,
  logo: 'https://images.toruswallet.io/sol.svg',
};

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

const web3AuthOptions: Web3AuthOptions = {
  clientId: WEB3AUTH_CLIENT_ID,
  web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET
  privateKeyProvider,
  uiConfig: {
    appName: 'OFAI',
    mode: 'dark',
    theme: {
      primary: '#FF00FF',
    },
    loginMethodsOrder: ['google', 'apple', 'facebook', 'twitter'],
    modalZIndex: '9999999',
  },
  sessionTime: 86400 * 7,
};

export const web3auth = new Web3Auth(web3AuthOptions);

getDefaultExternalAdapters({ options: web3AuthOptions }).then((adapters) => {
  adapters.forEach((adapter) => {
    web3auth.configureAdapter(adapter);
  });
});

await web3auth.initModal();

const token = await web3auth.authenticateUser();
const solWallet = new SolanaWallet(web3auth.provider);
const accounts = await solWallet.requestAccounts();

console.log(accounts[0])

here’s the wallet address when gmail login

When I am doing the same way on only1.app, I can access the wallet address correctly. They are using Solana as well.

here’s the video link.
https://www.awesomescreenshot.com/video/28755272?key=be5ebde2456f5ea76be1a3cb8922b468

would like to have a call with you to better explain and get help.

recently we upgrade our plan to scale, but still can’t solve this issue.

Hi @joenry95,

I will consult with the team and respond to you shortly.

@TomTom any updates here?

Hey @joenry95 sorry for the delays, from what I read in the thread, you want to access the same wallet address of Torus, please correct me if wrong.

If you intend to do so, you can use the Torus Solana Wallet Adapter. It’ll give you the same wallet address of Torus Solana. Please follow the docs for using Torus Solana Wallet Adapter.

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