trustwallet / trust-wallet-ios

:iphone: Trust - Ethereum Wallet and Web3 DApp Browser for iOS
https://trustwallet.com
GNU General Public License v3.0
1.52k stars 721 forks source link

Add generic passwork checker before sending transaction #867

Open ghost opened 6 years ago

ghost commented 6 years ago

Referencing #830, I will create new coordinator for this one, and reuse the LockEnterPasscodeViewController. I would like to get some info before finishing:

  1. Should we include biometric confirm, as well as passcode?
  2. Should we include 'Cancel' button for passcode screen? If so, should we store the current number of unsuccessful attempts?
  3. If the number of unsuccessful attempts is exceeded, should we log the user out?
vikmeup commented 6 years ago

@BloodyPixy I have added a new coordinator, forgot that name, take a look in the Lock coordinators. I haven’t done much tho.

vikmeup commented 6 years ago

Take a look at: https://github.com/TrustWallet/trust-wallet-ios/blob/55c1d9e48e3c9f5809fb2f1bd60c58cbac511e8b/Trust/Lock/Coordinators/AuthenticateUserCoordinator.swift

this has to be separated an tested. In order to make this work you need to add an option settings to ask for confirmation. Make sure use correct view model with messanging.

vikmeup commented 6 years ago

@BloodyPixy You need to pass view model that will describe actions!

ghost commented 6 years ago

I decided to put it inside of the lock. Seems logical to me, as we use Lock for keychain work with a passcode, and transaction authorization is directly connected to it. Good thing would be to have a new icon for this option in settings, as for now it uses same icon as Passcode app lock.

It works like this:

  1. User enables app passcode protection and sets the passcode
  2. New line in table appears with a switch to authorize transactions
  3. User can turn it 'on'
  4. If user turns App passcode lock off, transaction authorization will turn itself off as well.
  5. When user performs a transaction with Authorization turned on, app checks for this value, and presents passcode protection view.
  6. If the passcode is correct, transaction is executed.
vikmeup commented 6 years ago

Let's hold off on this one. It still requires UX/UI work to figure this out.