This is a response to a technical challenge to implement an email OTP module to be used for an enterprise application.
I could use any language, and chose to use Ruby due to development speed under a tight deadline.
In order to exectute the file using the command line:
- Save the file to your local hard disk
- Download Ruby compiler
- Execute the file by typing "ruby [path of the file on your local hard disk]"
- note that this program does not send emails, which is assumed to be done in another enterprise module. This module is solely responsible for generating and testing an OTP sent by email.
Features:
- A random 6 digit OTP is sent to a user that enters a "@gmail.com" email account (you can change the email required in the regex statement)
- The user is logged out after 10 failed attempts to input OTP
- The OTP expires after 1 minute
Success:
A random 6 digit OTP is sent to a user that enters an "@gmail.com" email account:
The user is logged out after 10 failed attempts to input OTP:
The user is logged out after 1 minute: