I'm building an OTP and have implemented the ROTP gem. However, the behaviour of the ROTP is not what I expected it to be.
For instance, when requesting a ROTP with 30secs of interval
at 15:00:14, this will return you an OTP say 212321
at 15:00:30, however, this will return you a new OTP say 312932
Notice how it hasn't reached 30 secs of expiry but already returns you a new otp
My expected behaviour of a time based OTP is
at 15:00:14, this will return you an OTP say 212321
at 15:00:30, will still return 212321
at 15:00:44, will return a new OTP because it has reached the 30 secs of expiry interval
How can I achieve my expected behaviour of a time based OTP?