kryptokay / kwallet

0 stars 0 forks source link

Verify the validity of the key created by the user #8

Open rmallols opened 6 years ago

rmallols commented 6 years ago

So we already managed to create and persist keys. Then it's time to prove validate keys on the LoginToWallet component.

  1. If the key exists (that means, It was already created by the user), then show a success message.
  2. If not, then show an error message.
rmallols commented 6 years ago

Technical guidance:

  1. Create a new method called existsKey on the keys-manager.js module, which receives a key and returns:

    • true if the key already exists.
    • false otherwise. You essentially have to verify whether the key is already part of the keys array or not.
  2. When user enters a login key, please save it as part of the state of the LoginToWallet component

  3. When user clicks on the login button, call the existsKey created on the first step and then either display the success or error messages (conditional rendering) depending on the outcome