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

Add support for Metamask provider.enable() security functionality #304

Closed
bashlund opened this issue Dec 19, 2018 · 2 comments
Closed

Add support for Metamask provider.enable() security functionality #304

bashlund opened this issue Dec 19, 2018 · 2 comments
Assignees
Labels
feature-request New feature or request important

Comments

@bashlund
Copy link
Contributor

Environment/Browser

Any browser using Metamask

Description

This is about adapting to the braking change in how Metamask exposes users accounts.

Steps to reproduce

  1. Enable the new security feature in Metamask settings (will later be defaulted to on)
  2. Unlock Metamask
  3. Open the developer console and see that no accounts are provided to Lab: web3.eth.accounts
  4. In the console run: web3.currentProvider.enable(), this should pop up the confirmation window about Lab accessing MM accounts. Confirm the request.
    image
  5. See that in Lab and in the console the account is now accessible: web3.eth.accounts

Suggested solution

This is a asynchronous call (to enable Metamask) and it will take a lot of effort to inject it everywhere we are using web3.eth.accounts.
An easier solution would be to add a Enable Metamask button somewhere in the UI, which will do the enabling of the connection for us.
Lab will treat an un-enabled Metamask as it is unlocked, so if we change some of the notifications/warnings/errors about "Metamask being locked" to "Metamask is locked and/or not enabled", users will know they need to enable Metamask for Lab before using it.

Reproducible

100%
After confirming once, Metamask will remember the confirmation.

@javier-tarazaga javier-tarazaga added feature-request New feature or request important labels Dec 19, 2018
@javier-tarazaga javier-tarazaga self-assigned this Dec 19, 2018
@javier-tarazaga
Copy link
Contributor

@bashlund wouldn't this change only be relevant in the case you are working on with a public network right?> Why instead of adding a button, simply request this permission in the moment you change to a public network?

@bashlund
Copy link
Contributor Author

bashlund commented Dec 19, 2018

@javier-tarazaga That is actually a very good idea. We would need to pop a modal which blocks the app until the user has unlocked and enabled Metamask, or until she cancels by choosing Browser/Custom network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request important
Projects
None yet
Development

No branches or pull requests

3 participants