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

Bug: Dapp connects to user Coinbase wallet without authorization pop-up window #1109

Closed
zhangxiangqiang opened this issue Jan 5, 2024 · 0 comments
Labels
type: bug Something isn't working

Comments

@zhangxiangqiang
Copy link

Describe the bug

Dapp connects to user Coinbase wallet without authorization pop-up window

Steps

I am creating a DAPP and configuring Coinbase/Wallet SDK according to the official documentation. Using Ethereum. request ({method: 'eth_requestAccounts'}), I can connect to the wallet, but the problem is that there is no prompt during this process. I would like a user authorization pop-up window. This feature is very common in other wallet SDKs, such as the connect feature in Metamak SDKs, which can easily trigger authorization pop ups; But in the documentation of Coinbase, I cannot find the corresponding method;

Expected behavior

In Coinbase browser, in Dapp, when I try to connect to the wallet, there should be a pop-up window that prompts the user for authorization

Version

3.7.2

Additional info

I tried the following two methods:

ethereum.request({ method: 'eth_requestAccounts' }).then(response => {
const accounts : string[] = response as string[];
console.log(User's address is ${accounts[0]});

  // Optionally, have the default account set for web3.js
  // (web3 as any).eth.defaultAccount = accounts[0];
  loginHandle(accounts?.[0]);
});

// Alternatively, you can use ethereum.enable()
ethereum.enable().then((accounts: string[]) => {
  console.log(`User's address is ${accounts[0]}`, 'enable');
  loginHandle(accounts?.[0]);
  // (web3 as any).eth.defaultAccount = accounts[0];
});

Desktop

Mobile (Android) Coinbase browser

Smartphone

No response

@zhangxiangqiang zhangxiangqiang added the type: bug Something isn't working label Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Development

No branches or pull requests

1 participant