Browse Source

Add compat with older versions of devise

master
Gaurish Sharma 8 years ago
parent
commit
ffbad70848
  1. 6
      app/controllers/devise/two_factor_authentication_controller.rb

6
app/controllers/devise/two_factor_authentication_controller.rb

@ -26,7 +26,11 @@ class Devise::TwoFactorAuthenticationController < DeviseController
set_remember_two_factor_cookie(resource)
warden.session(resource_name)[TwoFactorAuthentication::NEED_AUTHENTICATION] = false
bypass_sign_in(resource, scope: resource_name)
if respond_to?(:bypass_sign_in)
bypass_sign_in(resource, scope: resource_name)
else
sign_in(resource_name, resource, bypass: true)
end
set_flash_message :notice, :success
resource.update_attribute(:second_factor_attempts_count, 0)

Loading…
Cancel
Save