mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Set the new default for reconfirmable config
This commit is contained in:
parent
93df02f601
commit
6e419ce821
4 changed files with 5 additions and 19 deletions
|
@ -143,20 +143,8 @@ module Devise
|
||||||
@@confirmation_keys = [:email]
|
@@confirmation_keys = [:email]
|
||||||
|
|
||||||
# Defines if email should be reconfirmable.
|
# Defines if email should be reconfirmable.
|
||||||
# False by default for backwards compatibility.
|
mattr_accessor :reconfirmable
|
||||||
# TODO: 4.1 Do: @@reconfirmable = true
|
@@reconfirmable = true
|
||||||
mattr_reader :reconfirmable
|
|
||||||
@@reconfirmable = false
|
|
||||||
|
|
||||||
def self.reconfirmable=(reconfirmable)
|
|
||||||
app_set_configs << :reconfirmable
|
|
||||||
@@reconfirmable = reconfirmable
|
|
||||||
end
|
|
||||||
|
|
||||||
def reconfirmable=(reconfirmable)
|
|
||||||
app_set_configs << :reconfirmable
|
|
||||||
@@reconfirmable = reconfirmable
|
|
||||||
end
|
|
||||||
|
|
||||||
# Time interval to timeout the user session without activity.
|
# Time interval to timeout the user session without activity.
|
||||||
mattr_accessor :timeout_in
|
mattr_accessor :timeout_in
|
||||||
|
@ -319,7 +307,6 @@ module Devise
|
||||||
def self.setup
|
def self.setup
|
||||||
yield self
|
yield self
|
||||||
|
|
||||||
warn_default_config_changed(:reconfirmable, 'false', 'true')
|
|
||||||
warn_default_config_changed(:sign_out_via, ':get', ':delete')
|
warn_default_config_changed(:sign_out_via, ':get', ':delete')
|
||||||
warn_default_config_changed(:skip_session_storage, '[]', '[:http_auth]')
|
warn_default_config_changed(:skip_session_storage, '[]', '[:http_auth]')
|
||||||
end
|
end
|
||||||
|
|
|
@ -38,7 +38,6 @@ class DeviseTest < ActiveSupport::TestCase
|
||||||
test 'setup block warns about defaults changing' do
|
test 'setup block warns about defaults changing' do
|
||||||
Devise.app_set_configs = Set.new
|
Devise.app_set_configs = Set.new
|
||||||
|
|
||||||
ActiveSupport::Deprecation.expects(:warn).with() { |value| value =~ /reconfirmable/ }
|
|
||||||
ActiveSupport::Deprecation.expects(:warn).with() { |value| value =~ /sign_out_via/ }
|
ActiveSupport::Deprecation.expects(:warn).with() { |value| value =~ /sign_out_via/ }
|
||||||
ActiveSupport::Deprecation.expects(:warn).with() { |value| value =~ /skip_session_storage/ }
|
ActiveSupport::Deprecation.expects(:warn).with() { |value| value =~ /skip_session_storage/ }
|
||||||
|
|
||||||
|
@ -50,7 +49,6 @@ class DeviseTest < ActiveSupport::TestCase
|
||||||
ActiveSupport::Deprecation.expects(:warn).never
|
ActiveSupport::Deprecation.expects(:warn).never
|
||||||
|
|
||||||
swap Devise,
|
swap Devise,
|
||||||
reconfirmable: false,
|
|
||||||
sign_out_via: :get,
|
sign_out_via: :get,
|
||||||
skip_session_storage: [] do
|
skip_session_storage: [] do
|
||||||
Devise.setup do
|
Devise.setup do
|
||||||
|
|
|
@ -4,7 +4,8 @@ module SharedUser
|
||||||
included do
|
included do
|
||||||
devise :database_authenticatable, :confirmable, :lockable, :recoverable,
|
devise :database_authenticatable, :confirmable, :lockable, :recoverable,
|
||||||
:registerable, :rememberable, :timeoutable,
|
:registerable, :rememberable, :timeoutable,
|
||||||
:trackable, :validatable, :omniauthable, password_length: 7..72
|
:trackable, :validatable, :omniauthable, password_length: 7..72,
|
||||||
|
reconfirmable: false
|
||||||
|
|
||||||
attr_accessor :other_key
|
attr_accessor :other_key
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ module SharedUserWithoutOmniauth
|
||||||
included do
|
included do
|
||||||
devise :database_authenticatable, :confirmable, :lockable, :recoverable,
|
devise :database_authenticatable, :confirmable, :lockable, :recoverable,
|
||||||
:registerable, :rememberable, :timeoutable,
|
:registerable, :rememberable, :timeoutable,
|
||||||
:trackable, :validatable
|
:trackable, :validatable, reconfirmable: false
|
||||||
end
|
end
|
||||||
|
|
||||||
def raw_confirmation_token
|
def raw_confirmation_token
|
||||||
|
|
Loading…
Reference in a new issue