Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

feat: locks passcode screen on too many wrong consecutive attempts #661

Merged
merged 11 commits into from
May 6, 2021

Conversation

itofarina
Copy link
Contributor

@itofarina itofarina commented Apr 19, 2021

Features

  • Avoids users to enter passcodes on too many consecutive wrong attempts
  • Adds countdown timer to show when users can retry
  • Handles steps for retries dynamically
  • Persists wrong attempts count and last attempt timestamp between sessions
  • Adds loader while checking if user can already retry

Known issues

  • I just got the translation from Google so not sure if they are the most accurate
  • It might be better to map props to state and read them on componentWillReceiveProps instead of using baseModal.resetModal(...), but that would require a refactor of the base modal dependencies as well (reset passcode, create new passcode, wrong passcode

How to test

  • Wrong retries count and timer should persist between sessions (ie: closing and re-opening the app)
  • With the provided configuration, the app should behave like this:
    STEP_1
    6 consecutive -> 1 minute wait
An iPhone will disable for 1 minute after six failed passcode attempts in a row
STEP_2
    7 consecutive -> 5 minutes
STEP_3
    8 consecutive -> 15 minutes
STEP_4
    10 or more consecutive -> 1 hour
  • The steps can be changed on src/components/common/passcode/wrongPasscodeUtils.js -> WRONG_ATTEMPTS_STEPS

Screenshots

Screen Shot 2021-04-22 at 17 23 54

@itofarina itofarina self-assigned this Apr 19, 2021
@itofarina itofarina force-pushed the feat/passcodeRestrictions branch from 096eece to c67e613 Compare April 20, 2021 18:56
@itofarina itofarina marked this pull request as ready for review April 22, 2021 20:18
@itofarina itofarina force-pushed the feat/passcodeRestrictions branch from 50a42dd to 7b61d50 Compare April 22, 2021 20:20
@jessgusclark
Copy link
Member

I'm also getting this when I launch the app, it seems to be stuck here. There is a passcode that already exists in storage.

simulator_screenshot_ECBC6FA4-9216-4B3C-A171-7AFD40E7547B

@itofarina itofarina requested a review from jessgusclark April 28, 2021 18:41
Copy link
Member

@jessgusclark jessgusclark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@itofarina itofarina requested a review from jjtechuy April 29, 2021 16:45
@patogallaiovlabs patogallaiovlabs added this to the v1.4.3 milestone May 3, 2021
Copy link

@jjtechuy jjtechuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified using ios simulator!
image

@patogallaiovlabs patogallaiovlabs merged commit 6b2a768 into master May 6, 2021
@patogallaiovlabs patogallaiovlabs deleted the feat/passcodeRestrictions branch May 6, 2021 11:49
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants