southbridgeio / redmine_2fa

Two-factor (sms/telegram) authentication for Redmine
https://southbridge.io
MIT License
42 stars 17 forks source link

undefined method `verify_with_drift' #68

Closed pechenkin655 closed 3 years ago

pechenkin655 commented 5 years ago

Using apache 2.4.18 Phusion Passenger 5.3.5 ruby 2.3.7p456 Rails 4.2.8

Steps:

Result: Error page and this in apache log files:

App 18233 output: Started POST "/redmine_2fa/otp_code/confirm" for 192.168.0.2 at 2018-11- 05 16:18:38 +0200 App 18233 output: Processing by AccountController#confirm_otp as HTML App 18233 output: Parameters: {"utf8"=>"✓", "authenticity_token"=>"srFtBVhJ71108gLHtbAEK ODIhalLKN421RI0UJmBkDIq35o4edqXTzZBQHl514qMjczLowBxZ8H92/iYJnWEHg==", "otp_code"=>"111111" , "protocol"=>"google_auth", "login"=>"Next;"} App 18233 output: Current user: anonymous App 18233 output: Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.8ms) App 18233 output: App 18233 output: NoMethodError (undefined method verify_with_drift' for #<ROTP::TOTP:0x0 0007fb37c6cec88>): App 18233 output: plugins/redmine_2fa/lib/redmine_2fa/patches/account_controller_patch/c onfirm_methods.rb:29:inconfirm_otp' App 18233 output: lib/redmine/sudo_mode.rb:63:in `sudo_mode'

sangxing commented 5 years ago

Using Nginx 1.10.3 Phusion Passenger 5.3.7 ruby 2.3.8p459 Rails 4.2.8

Steps:

In plugins config leave only Google authenticator Logoff Try to login - pairing code will apper Scan code with Google authenticator app and write code to text field Press "Next;" button

Result: Error page and this in apache log files:

Started POST "/redmine_2fa/otp_code/confirm" for 192.168.0.3 at 2018-11-14 21:49:23 +0800 Processing by AccountController#confirm_otp as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"uTQLUhNumNPpIGVEC4GiEOY6ewpKQNC7vDqN2BqBknPrdtX790Iv2XA72PvOCvFWODO6LESDImSs7VNagIUbdA==", "otp_code"=>"578370", "protocol"=>"google_auth", "login"=>"Next;"} Current user: anonymous Completed 500 Internal Server Error in 7ms (ActiveRecord: 1.1ms)

NoMethodError (undefined method verify_with_drift' for #<ROTP::TOTP:0x00007f82dad61208>): plugins/redmine_2fa/lib/redmine_2fa/patches/account_controller_patch/confirm_methods.rb:29:inconfirm_otp' lib/redmine/sudo_mode.rb:63:in `sudo_mode'

RexQian commented 5 years ago

update active_model_otp version in Gemfile fixes this issue gem 'active_model_otp', :git => 'https://github.com/heapsource/active_model_otp.git'