MSG91 / sendotp-node

38 stars 24 forks source link

OTP expiry after one successful verification #18

Open rohit-raj opened 6 years ago

rohit-raj commented 6 years ago

Hi, Is there any feature of verifying the otp only once and then the otp expires after one successful verification.

Incase, the feature is present, kindly let me know how to use it, if not then will that be added soon ?

I have used otp expiry, but in my implementation, I need it to expire after one successful verification.

rwalkover commented 6 years ago

Hello, @rohit-raj Currently we do not have such option to restrict verification to single time only.

Will let you know if this feature available in future.

rwalkover commented 6 years ago

@rohit-raj Can you please elaborate your requirement so that we can better understand your problem and help to solve it.

rohit-raj commented 6 years ago

Actually, I was trying to implement a phone number update feature. Step 1> The user inputs a number to generate an OTP(Let's say 1st OTP). Step 2> Then the user verifies the Phone number by this OTP. Step 3> Now the user again changes the phone number to generate a new OTP. Step 4> Again verifies the phone with new OTP. Step 5> Again enters the 1st Phone number and 1st OTP. This allows the user to again verify the phone number without even generating the OTP.

This process can be repeated till the OTP is timed out. In my opinion, whenever a user uses an OTP to verify the phone number, then that OTP must be expired after successful verification..