Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unable to detect device share." Error when using web3auth/core, but not when using web3auth/modal #1375

Open
moldy530 opened this issue Feb 24, 2023 · 3 comments

Comments

@moldy530
Copy link

Getting "Unable to detect device share." error when using connectTo("openlogin", loginParams) but not when using connect()

If I use web3auth/modal and I'm able to successfully connect with openlogin as long as I use the connect() method. However, if I want to use web3auth/core (ie. connectTo) I get the Unable to detect device share screen

To Reproduce

Steps to reproduce the behavior:

  1. Setup web3auth modal as described in: https://web3auth.io/docs/sdk/web/modal/initialize
  2. call web3auth.connect() --> this should show the modal and the flow should succeed
  3. swap the call from web3auth.connect to something like web3auth.connectTo("openlogin", loginParams: {loginProvider: "google"}) (use the same method as you did in 2 and the same account)
  4. going through the flow will work on first attempt (ie. account has never been registered to web3auth before). Logout of web3auth or use a different chrome profile and connect again. See the error screen below
    4a. I noticed that the public address is also different between the two methods when connectTo succeeds the first time.

Expected behavior

I would expect:

  1. connectTo to work successfully across devices, profiles, and sessions the same as connect
  2. the resulting public keys to be the same regardless of whether I'm using connect or connectTo

Screenshots

image

Device Info (please complete the following information):

  • Device: Macbook Pro
  • OS: MacOS
  • Browser: Chrome
  • Version: 110.0.5481.177
  • Web3Auth Version: @web3auth/[email protected]

Additional context

My setup:

const web3auth = new Web3Auth({
  clientId: "<MY_CLIENT_ID>",
  chainConfig: {
    chainNamespace: "eip155",
  },
  enableLogging: true,
  web3AuthNetwork: "testnet",
  storageKey: "local",
});
const openloginAdapter = new OpenloginAdapter({
  adapterSettings: {
    uxMode: "popup",
    network: "testnet",
    storageKey: "local",
  },
  loginSettings: {
    mfaLevel: "mandatory",
  },
});
web3auth.configureAdapter(openloginAdapter);

useEffect(() => {
    if (web3auth.status === "not_ready") {
      web3auth.initModal({
        modalConfig: {
          "torus-evm": {
            label: "Torus Wallet",
            showOnModal: false,
          },
          metamask: {
            label: "Metamask",
            showOnModal: false,
          },
          "wallet-connect-v1": {
            label: "Wallet Connect",
            showOnModal: false,
          },
        },
      });
}, [])

const login = (
    loginProvider: LoginProvider
) => {
    await web3auth.logout().catch(() => null); // this is here to just to repro the issue

    // comment out one of these to test independently
    await web3auth.connect(); // this works consistently
    await web3auth.connectTo("openlogin", loginParams: { loginProvider }); // this does not work after first time logging in
}
@moldy530
Copy link
Author

possibly related? #1238

@chusla
Copy link

chusla commented Mar 30, 2023

hello i'm seeing this one as well, anyone from web3auth able to provide info on fixes?

IMG_1660

@Jo-Chris
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants