Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Preventing reuse of Time based OTP's" not working #112

Open
aditya-kreditz opened this issue Jun 8, 2023 · 1 comment
Open

"Preventing reuse of Time based OTP's" not working #112

aditya-kreditz opened this issue Jun 8, 2023 · 1 comment

Comments

@aditya-kreditz
Copy link

I have applied this gem to my "User' Model like this:

class User < ApplicationRecord
  has_one_time_password interval: 600, after_column_name: :last_otp_at
end

Here I have set interval of 10 minutes for otp. I want to make it invalid once authenticated. But even after authenticating once, It can be authnticated again.

User.last.otp_code => "985983"
User.last.authenticate_otp("985983") => true
User.last.authenticate_otp("985983") => true

Also there is no update in last_otp_at column.
User.last.last_otp_at => nil

Am I missing something? What else I need to do?

@aditya-kreditz
Copy link
Author

Sorry. There was a mistake at my end. Gem version was 2.3.1. Now upgraded to 2.3.2 and getting last_otp_at time. Now It authenticates once. But it doesn't generate new otp before time interval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant