-
Notifications
You must be signed in to change notification settings - Fork 247
Closed
Description
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:
- Setup web3auth modal as described in: https://web3auth.io/docs/sdk/web/modal/initialize
- call
web3auth.connect()
--> this should show the modal and the flow should succeed - swap the call from
web3auth.connect
to something likeweb3auth.connectTo("openlogin", loginParams: {loginProvider: "google"})
(use the same method as you did in 2 and the same account) - 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 whenconnectTo
succeeds the first time.
Expected behavior
I would expect:
connectTo
to work successfully across devices, profiles, and sessions the same asconnect
- the resulting public keys to be the same regardless of whether I'm using
connect
orconnectTo
Screenshots
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
}
Astrak
Metadata
Metadata
Assignees
Labels
No labels