Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

generateKeyPair in Browsers Without Webpack #737

Closed
bradlhart opened this issue Jun 3, 2020 · 1 comment
Closed

generateKeyPair in Browsers Without Webpack #737

bradlhart opened this issue Jun 3, 2020 · 1 comment
Assignees
Labels

Comments

@bradlhart
Copy link
Contributor

Version of EOSJS
eosjs RC and edge

Describe the bug
To generate a public/private key pair, you need to specify that you are aware of the implications of generating a private key in an unsafe environment. Unfortunately, the only way to set that is with process.env which works for both nodejs and webpack projects but not browser alone. There needs to be an option for an alternative variable that can be set, such as window.EOSJS_KEYGEN_ALLOWED

To Reproduce
Steps to reproduce the behavior:

  1. Attempt to use eosjs-key-conversions.generateKeyPair in browser without webpack
  2. Receive error to set environment variable but no ability to set it in browser

Expected behavior
An additional alternative option to set the variable in the window or global objects for browsers

@bradlhart
Copy link
Contributor Author

Edge version of the npm package has this change. Add { secureEnv: true } as part of the options for generateKeyPair to confirm your environment is secure. Environment variables are no longer necessary.

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

No branches or pull requests

1 participant