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