Closed asehra closed 3 years ago
Is it ok, that I get 0 as return value? I am using counter based OTP.
@Pahicz , it seems that for counter based OTP, ROTP returns the value of the counter instead of the timestamp. nil
still means that the token is not verified. Here's the documentation from ROTP: https://github.com/mdp/rotp#counter-based-otps
We run through this problem too. Getting a timestamp or nil (when it should be false). Any update or workaround for this?
@kevinhq , this gem, active_model_otp
respects the response received from rotp
, the gem that does all the heavy-lifting:
For time-based tokens, rotp
will return an integer timestamp for success or nil for failure.
For counter-based tokens, rotp
will return the current count for success or nil for failure.
The docs on this gem should probably be updated, but I don't see much activity from the maintainer.
PR https://github.com/heapsource/active_model_otp/pull/85 merged 🎉
ROTP changed their implementation of
verify
to return timestamp (eg 1561654770) when the otp is valid and nil otherwise instead of atrue
orfalse
. README still says thatauthenticate_otp
returnstrue
orfalse
.