Open danielb2 opened 1 year ago
Hi @danielb2, can you try to check u.errors
after checking u.authenticate_otp u.otp_code
?
I see that in the code we are using update
instead of update!
so this might be failing silently:
https://github.com/heapsource/active_model_otp/blob/main/lib/active_model/one_time_password.rb#L157
Hi thank you for your response. it's empty: #<ActiveModel::Errors []>
any more ideas?
Hi @danielb2 Have you tried upgrading gem to 2.3.2. I did the same and last otp at column updated. But issue I am facing is with interval. I have set interval to 10 minutes. And once authenticated, it returns false later but it doesn't generate new otp for 10 minutes. So I get same otp again for 10 minutes. I tried it with default interval but same issue occurs. Though 30 seconds is not a very long interval so goes unnoticed. But for longer interval, this functionality is useless.
I'm having an issue with last_otp_at not being set
in the user model and migration:
any ideas why this would happen?