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

ethereum.enable() doesn't throw when user rejects popup. #6631

Closed
nameskang opened this issue May 19, 2019 · 2 comments · Fixed by #6671
Closed

ethereum.enable() doesn't throw when user rejects popup. #6631

nameskang opened this issue May 19, 2019 · 2 comments · Fixed by #6671
Assignees
Labels
area-provider Relating to the provider module. type-bug

Comments

@nameskang
Copy link

nameskang commented May 19, 2019

Describe the bug
Calling ethereum.enable() while user has privacy mode enabled does not throw when he doesn't allow the dapp to view his account address. Instead it returns normally but the accounts array is undefined. Cannot catch user denying access via promise .catch() nor standard try..catch.

To Reproduce
Steps to reproduce the behavior:

  1. Call ethereum.enable() making sure to handle both success and fail cases (example code here in the docs)
  2. Reject the metamask popup
  3. See that ethereum.enable() did not throw and returned array is undefined

Expected behavior
Acording to docs, calling ethereum.enable() while user has privacy mode enabled should throw when he doesn't allow the dapp to view his account address.

Browser details (please complete the following information):

  • OS: OS X
  • Browser: Chrome and Brave
  • MetaMask Version: 6.5.3 (latest)

Additional context
Problem can be observed here: https://codesandbox.io/s/5zrjm

@nameskang
Copy link
Author

I tested previous versions and it looks like it has been broken since 6.5.0. Version 6.4.1 is the last one with expected behaviour.

@danfinlay
Copy link
Contributor

Good catch and documentation, thank you! Will be fixed in the next release, early next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-provider Relating to the provider module. type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants