devise-secure_password 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/coverage/assets/0.10.2/application.css +799 -0
  3. data/coverage/assets/0.10.2/application.js +1707 -0
  4. data/coverage/assets/0.10.2/colorbox/border.png +0 -0
  5. data/coverage/assets/0.10.2/colorbox/controls.png +0 -0
  6. data/coverage/assets/0.10.2/colorbox/loading.gif +0 -0
  7. data/coverage/assets/0.10.2/colorbox/loading_background.png +0 -0
  8. data/coverage/assets/0.10.2/favicon_green.png +0 -0
  9. data/coverage/assets/0.10.2/favicon_red.png +0 -0
  10. data/coverage/assets/0.10.2/favicon_yellow.png +0 -0
  11. data/coverage/assets/0.10.2/loading.gif +0 -0
  12. data/coverage/assets/0.10.2/magnify.png +0 -0
  13. data/coverage/assets/0.10.2/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  14. data/coverage/assets/0.10.2/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  15. data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  16. data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  17. data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  18. data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  19. data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  20. data/coverage/assets/0.10.2/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  21. data/coverage/assets/0.10.2/smoothness/images/ui-icons_222222_256x240.png +0 -0
  22. data/coverage/assets/0.10.2/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  23. data/coverage/assets/0.10.2/smoothness/images/ui-icons_454545_256x240.png +0 -0
  24. data/coverage/assets/0.10.2/smoothness/images/ui-icons_888888_256x240.png +0 -0
  25. data/coverage/assets/0.10.2/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  26. data/coverage/index.html +4127 -0
  27. data/gemfiles/rails-5_0_6.gemfile.lock +286 -0
  28. data/gemfiles/rails-5_1_4.gemfile.lock +282 -0
  29. data/lib/devise/secure_password/controllers/active_helpers.rb +7 -2
  30. data/lib/devise/secure_password/controllers/devise_helpers.rb +7 -4
  31. data/lib/devise/secure_password/models/previous_password.rb +2 -2
  32. data/lib/devise/secure_password/version.rb +1 -1
  33. data/pkg/devise-secure_password-1.0.3.gem +0 -0
  34. metadata +30 -2
@@ -18,13 +18,18 @@ module Devise
18
18
  warden.authenticated? && warden.session['secure_password_last_controller'] == 'Devise::SessionsController'
19
19
  end
20
20
 
21
+ # Prevent infinite loops and allow specified controllers to bypass.
22
+ # @NOTE: The ability to extend this list may be made public, in the
23
+ # future if that functionality is needed.
21
24
  def skip_current_controller?
22
25
  exclusion_list = [
23
26
  'Devise::SessionsController',
24
27
  'Devise::PasswordsWithPolicyController#edit',
25
- 'Devise::PasswordsWithPolicyController#update'
28
+ 'Devise::PasswordsWithPolicyController#update',
29
+ 'DeviseInvitable::RegistrationsController#edit',
30
+ 'DeviseInvitable::RegistrationsController#update'
26
31
  ]
27
- exclusion_list.select { |e| e == "#{self.class.name}#" + action_name || e == self.class.name.to_s }.empty?
32
+ !(exclusion_list.include?("#{self.class.name}#" + action_name) || (exclusion_list & self.class.ancestors.map(&:to_s)).any?)
28
33
  end
29
34
 
30
35
  def error_string_for_password_expired
@@ -10,9 +10,9 @@ module Devise
10
10
 
11
11
  protected
12
12
 
13
- # Override the devise require_no_authentication before callback so users
14
- # have to prevent authenticated users with expired passwords from
15
- # escaping to other pages without first updating their passwords.
13
+ # Override the devise require_no_authentication before callback to
14
+ # prevent authenticated users with expired passwords from escaping to
15
+ # other pages without first updating their passwords.
16
16
  def require_no_authentication
17
17
  return if check_password_expired_and_redirect!
18
18
 
@@ -42,11 +42,14 @@ module Devise
42
42
  warden.session(scope_name)[:secure_last_action] = action_name
43
43
  end
44
44
 
45
+ # Prevent infinite loops and allow specified controllers to bypass.
46
+ # @NOTE: The ability to extend this list may be made public, in the
47
+ # future if that functionality is needed.
45
48
  def skip_current_devise_controller?
46
49
  exclusion_list = [
47
50
  'Devise::SessionsController'
48
51
  ]
49
- exclusion_list.select { |e| e == "#{self.class.name}#" + action_name || e == self.class.name.to_s }.empty?
52
+ !(exclusion_list.include?("#{self.class.name}#" + action_name) || (exclusion_list & self.class.ancestors.map(&:to_s)).any?)
50
53
  end
51
54
 
52
55
  def error_string_for_password_expired
@@ -9,11 +9,11 @@ module Devise
9
9
  validates :encrypted_password, presence: true
10
10
 
11
11
  def fresh?(minimum_age_duration, now = ::Time.zone.now)
12
- now <= (created_at + minimum_age_duration)
12
+ now <= (updated_at + minimum_age_duration)
13
13
  end
14
14
 
15
15
  def stale?(maximum_age_duration, now = ::Time.zone.now)
16
- now > (created_at + maximum_age_duration)
16
+ now > (updated_at + maximum_age_duration)
17
17
  end
18
18
  end
19
19
  end
@@ -1,5 +1,5 @@
1
1
  module Devise
2
2
  module SecurePassword
3
- VERSION = '1.0.3'.freeze
3
+ VERSION = '1.0.4'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise-secure_password
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Eissler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-24 00:00:00.000000000 Z
11
+ date: 2018-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise
@@ -424,11 +424,38 @@ files:
424
424
  - "./bin/console"
425
425
  - "./bin/setup"
426
426
  - "./config/locales/en.yml"
427
+ - "./coverage/assets/0.10.2/application.css"
428
+ - "./coverage/assets/0.10.2/application.js"
429
+ - "./coverage/assets/0.10.2/colorbox/border.png"
430
+ - "./coverage/assets/0.10.2/colorbox/controls.png"
431
+ - "./coverage/assets/0.10.2/colorbox/loading.gif"
432
+ - "./coverage/assets/0.10.2/colorbox/loading_background.png"
433
+ - "./coverage/assets/0.10.2/favicon_green.png"
434
+ - "./coverage/assets/0.10.2/favicon_red.png"
435
+ - "./coverage/assets/0.10.2/favicon_yellow.png"
436
+ - "./coverage/assets/0.10.2/loading.gif"
437
+ - "./coverage/assets/0.10.2/magnify.png"
438
+ - "./coverage/assets/0.10.2/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png"
439
+ - "./coverage/assets/0.10.2/smoothness/images/ui-bg_flat_75_ffffff_40x100.png"
440
+ - "./coverage/assets/0.10.2/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png"
441
+ - "./coverage/assets/0.10.2/smoothness/images/ui-bg_glass_65_ffffff_1x400.png"
442
+ - "./coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_dadada_1x400.png"
443
+ - "./coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png"
444
+ - "./coverage/assets/0.10.2/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png"
445
+ - "./coverage/assets/0.10.2/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png"
446
+ - "./coverage/assets/0.10.2/smoothness/images/ui-icons_222222_256x240.png"
447
+ - "./coverage/assets/0.10.2/smoothness/images/ui-icons_2e83ff_256x240.png"
448
+ - "./coverage/assets/0.10.2/smoothness/images/ui-icons_454545_256x240.png"
449
+ - "./coverage/assets/0.10.2/smoothness/images/ui-icons_888888_256x240.png"
450
+ - "./coverage/assets/0.10.2/smoothness/images/ui-icons_cd0a0a_256x240.png"
451
+ - "./coverage/index.html"
427
452
  - "./devise-secure_password-1.0.0.gem"
428
453
  - "./devise-secure_password.gemspec"
429
454
  - "./docker-entrypoint.sh"
430
455
  - "./gemfiles/rails-5_0_6.gemfile"
456
+ - "./gemfiles/rails-5_0_6.gemfile.lock"
431
457
  - "./gemfiles/rails-5_1_4.gemfile"
458
+ - "./gemfiles/rails-5_1_4.gemfile.lock"
432
459
  - "./lib/devise/secure_password.rb"
433
460
  - "./lib/devise/secure_password/controllers/active_helpers.rb"
434
461
  - "./lib/devise/secure_password/controllers/devise_helpers.rb"
@@ -444,6 +471,7 @@ files:
444
471
  - "./lib/generators/devise/templates/README.txt"
445
472
  - "./lib/generators/devise/templates/secure_password.rb"
446
473
  - "./lib/support/string/character_counter.rb"
474
+ - "./pkg/devise-secure_password-1.0.3.gem"
447
475
  homepage: https://github.com/valimail/devise-secure_password
448
476
  licenses:
449
477
  - MIT