This PR introduces several new features to the user authentication dapp:
IP address verification: During registration, users are now required to provide their IP address. During login, the provided IP address is checked against the stored IP address for the user. If they do not match, the login attempt fails.
Login attempt tracking: Failed login attempts are now tracked. After two consecutive failed attempts, the system is inactivated for 2 minutes.
Login attempt logging: Logs of every login attempt are now stored. This allows for auditing and tracking of user login activity.
Summary of Changes
Modified the User struct in the Auth.sol contract to include an 'ip' field.
Modified the register function in the Auth.sol contract to accept an additional parameter for the IP address and store it in the User struct.
Modified the login function in the Auth.sol contract to check the IP address of the user attempting to login against the stored IP address. If they do not match, the login attempt fails.
Introduced a mechanism to count failed login attempts and inactivate the system for 2 minutes after two consecutive failed attempts.
Added a new mapping 'loginAttempts' to store logs of login attempts.
Modified the login function in the Auth.sol contract to add an entry to 'loginAttempts' every time a login attempt is made.
Modified the test cases in Auth.test.js to include the IP address parameter for register and login functions.
Added new test cases to verify the IP address check during login, the inactivation of the system after two consecutive failed login attempts, and the storage of login attempt logs.
Fixes #1.
To checkout this PR branch, run the following command in your terminal:
git checkout {pull_request.branch_name}
🎉 Latest improvements to Sweep:
Getting Sweep to format before committing! Check out Sweep Sandbox Configs to set it up.
We launched our browser extension making it faster to make Sweep issues.
We released a demo of our chunker, where you can find the corresponding blog and code.
💡 To get Sweep to edit this pull request, you can:
Leave a comment below to get Sweep to edit the entire PR
Leave a comment in the code will only modify the file
Edit the original issue to get Sweep to recreate the PR from scratch
Description
This PR introduces several new features to the user authentication dapp:
IP address verification: During registration, users are now required to provide their IP address. During login, the provided IP address is checked against the stored IP address for the user. If they do not match, the login attempt fails.
Login attempt tracking: Failed login attempts are now tracked. After two consecutive failed attempts, the system is inactivated for 2 minutes.
Login attempt logging: Logs of every login attempt are now stored. This allows for auditing and tracking of user login activity.
Summary of Changes
Fixes #1.
To checkout this PR branch, run the following command in your terminal:
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: