Browse Source

Fix merge conflict

master
Benjamin Wols 8 years ago
parent
commit
41a01acd85
  1. 3
      lib/two_factor_authentication.rb
  2. 4
      lib/two_factor_authentication/hooks/two_factor_authenticatable.rb
  3. 3
      lib/two_factor_authentication/models/two_factor_authenticatable.rb

3
lib/two_factor_authentication.rb

@ -30,6 +30,9 @@ module Devise
mattr_accessor :second_factor_resource_id
@@second_factor_resource_id = 'id'
mattr_accessor :delete_cookie_on_logout
@@delete_cookie_on_logout = false
end
module TwoFactorAuthentication

4
lib/two_factor_authentication/hooks/two_factor_authenticatable.rb

@ -11,3 +11,7 @@ Warden::Manager.after_authentication do |user, auth, options|
end
end
end
Warden::Manager.before_logout do |user, auth, _options|
auth.cookies.delete TwoFactorAuthentication::REMEMBER_TFA_COOKIE_NAME if user.class.delete_cookie_on_logout
end

3
lib/two_factor_authentication/models/two_factor_authenticatable.rb

@ -16,7 +16,8 @@ module Devise
::Devise::Models.config(
self, :max_login_attempts, :allowed_otp_drift_seconds, :otp_length,
:remember_otp_session_for_seconds, :otp_secret_encryption_key,
:direct_otp_length, :direct_otp_valid_for, :totp_timestamp)
:direct_otp_length, :direct_otp_valid_for, :totp_timestamp, :delete_cookie_on_logout
)
end
module InstanceMethodsOnActivation

Loading…
Cancel
Save