Mobile OTP Confirmation. Not tested yet.
Steps to start
- First of all register on https://msg91.com/. This service will enable you to send messages for mobile number configuration
- After registration you will get an Auth Key which will be used later.
- After that you can use this module for testing, implement in your projects or learn from it.
What to do with the Auth Key???
- Goto models folder
- Open otp.js
- Put your Auth Key there (in the 6th line, depends on your code editor)
How to test???
- Go to the folder in which app.js exists
- Open terminal or cmd there
- Run "node app.js" or "nodemon app.js" or whatever command you use to run the node apps
- Goto 127.0.0.1:3000/send
- Enter the number and click submit
- You will be directed to confirmation page
- Here you can either enter the otp (correct/wrong) depends on what you are testing
- Or, you can just try resending the otp
- If correct otp is entered, Success message is displayed else Failed
Remember otp would expire in 5 minutes
Test Cases:
- Wrong OTP
- Correct OTP
- Resend OTP
- Resend OTP, new OTP received but then also enter old OTP
- Resend OTP, enter new OTP
- Try entering OTP after 5 minutes