-
Notifications
You must be signed in to change notification settings - Fork 155
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
feat: make attemptLockout rules injectable in the Config interface #1433
feat: make attemptLockout rules injectable in the Config interface #1433
Conversation
Signed-off-by: fc-santos <filipesantos@live.ca>
Signed-off-by: fc-santos <filipesantos@live.ca>
Signed-off-by: fc-santos <filipesantos@live.ca>
Signed-off-by: fc-santos <filipesantos@live.ca>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not gonna stop this PR from being merged as-is, but I wonder if these two config objects (attemptLockoutBaseRules
and attemptLockoutThresholdRules
) could be merged and simplified a bit - just attemptLockoutRules
? It would be easier to read and remove the need for some of the destructuring and extra effect dependencies in PINEnter.tsx
. What do you think?
Signed-off-by: fc-santos <filipesantos@live.ca>
Signed-off-by: fc-santos <filipesantos@live.ca>
|
…penwallet-foundation#1433) Signed-off-by: fc-santos <filipesantos@live.ca> Signed-off-by: Mohamed Abd El-Samie Ahmad Mansour <masmas04@gmail.com>
…penwallet-foundation#1433) Signed-off-by: fc-santos <filipesantos@live.ca> Signed-off-by: Mohamed Abd El-Samie Ahmad Mansour <masmas04@gmail.com>
Summary of Changes
This PR makes the attempt lockout rules injectable in the Config interface. The default values are as seen in the
constants.ts
file. If a wallet decides to make their own rules, the attemptLockoutBaseRules keys need to be multiples of the attemptLockoutThresholdRules.attemptIncrement.Screenshots, videos, or gifs
N/A
Breaking change guide
N/A
Related Issues
This also fixes an issue where after the first 5 tries, the user gets locked out for 1 minute. After the user has served the 1 minute penalty, they can try again. But then if they make the wrong PIN, they get locked out right away and the penalty doesn't increase (it stays locked for 1 minute).
Pull Request Checklist
Tick all boxes below to demonstrate that you have completed the respective task. If the item does not apply to your this PR check it anyway to make it apparent that there's nothing to do.
Signed-off-by
line (we use the DCO GitHub app to enforce this)If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!
Pro Tip 🤓