heapsource / active_model_otp

Adds methods to set and authenticate against one time passwords (Two-Factor Authentication). Inspired in AM::SecurePassword
MIT License
769 stars 81 forks source link

add options for the interval of TOTP #17

Closed hjinu closed 9 years ago

hjinu commented 9 years ago

I need to change the interval of totp. So I added the option for it. Check it, please

robertomiranda commented 9 years ago

@hjinu I'm checking your PR, meanwhile could you squash your commits and the propers test cases?

robertomiranda commented 9 years ago

@hjinu everything looks good for me, any progress with the test cases?

hjinu commented 9 years ago

@robertomiranda I added the test cases! Check it, please.

-- update

There is the error I've made. I'll check it and notify you later. Sorry.

hjinu commented 9 years ago

@robertomiranda I don't know why It can't pass the test cases... Sometimes it passes, sometimes it can't pass them. Can you guess what the problem is?

robertomiranda commented 9 years ago

@hjinu you've added has_one_time_password column_name: :otp_token, length: 4, interval: 60to Visitor Model so you need to include the test cases using @visitorinstead of @user

hjinu commented 9 years ago

I added new model for testing, but it has same bug. I think there are some problems about interval. It's occasionally not working. I'll use drift instead of interval.

You can close this PR. Thanks.

robertomiranda commented 9 years ago

@hjinu ok np, anyway maybe could you post an issue in rotp gem?