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

is this gem works ? #51

Closed buncis closed 5 years ago

buncis commented 5 years ago

ruby 2.5.3 rails 5.2.2

I tried multiple gem version and rotp version the result is this

combination one

Gemfile

gem 'active_model_otp'
gem 'rotp'

produce error as in #48 when calling otp_code

ArgumentError: wrong number of arguments (given 2, expected 1)

combination two

Gemfile

gem 'active_model_otp', :git => 'https://github.com/heapsource/active_model_otp.git'
gem 'rotp', '~> 3.3.1'

otp_code working authenticate_otp working but when calling authenticate_otp with :drift option it produce error

`NoMethodError (undefined method `to_i' for {:drift_behind=>60}:Hash)` 

combination 3

Gemfile

gem 'active_model_otp', :git => 'https://github.com/heapsource/active_model_otp.git'
gem 'rotp'

otp_code working but authenticate_otp only returning nil

adet4ever commented 5 years ago

I was able to get this older commit to work. New code is good when it works but recent updates to the code has broken some functionalities: gem 'active_model_otp', :git => 'https://github.com/heapsource/active_model_otp.git', :ref => '4592b82c774892ce2111d33f0b56517f3c5f30ea' gem 'rotp', '~> 3.3.1'

cweilemann commented 5 years ago

Slight bump...

What am I missing here? The code looks okay to me with respect to working with rotp ~> 4.0 ... Curious why the undefined method 'verify_with_drift' is still happening?

ashiksp commented 5 years ago

Any updates here !

buncis commented 5 years ago

@ashiksp consider to implements the rotp to active record models by yourself

that's what I'm doing since this gem is just a wrapper for activerecord and such

robertomiranda commented 5 years ago

@buncismamen sorry about the delay of my response, we are putting efforts on maintaining this library back. Hopefully, the latest release should fix that you've mentioned.