devise_password_history 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
12
12
  gem.summary = %q{Password history support for devise}
13
13
  gem.homepage = "http://github.com/rpheath/devise_password_history"
14
14
 
15
- gem.add_dependency("devise", ["~> 2.2.0"])
15
+ gem.add_dependency("devise", ["> 2.0.0"])
16
16
 
17
17
  gem.files = `git ls-files`.split($/)
18
18
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -32,7 +32,9 @@ module Devise
32
32
  self.old_passwords.each do |old_pw|
33
33
  temp = self.class.new
34
34
  temp.encrypted_password = old_pw.encrypted_password
35
- temp.password_salt = old_pw.password_salt
35
+ if temp.respond_to?(:password_salt)
36
+ temp.password_salt = old_pw.password_salt
37
+ end
36
38
 
37
39
  # return true if this password "passes" (authenticates)
38
40
  return true if temp.valid_password?(self.password)
@@ -96,7 +98,9 @@ module Devise
96
98
  # record the old password
97
99
  old_pw = self.old_passwords.new
98
100
  old_pw.encrypted_password = self.encrypted_password_change.first
99
- old_pw.password_salt = self.password_salt_change.first if self.password_salt_change.present?
101
+ if self.respond_to?(:password_salt_change)
102
+ old_pw.password_salt = self.password_salt_change.first if self.password_salt_change.present?
103
+ end
100
104
  old_pw.save!
101
105
 
102
106
  # wipe out passwords beyond our desired count
@@ -1,3 +1,3 @@
1
1
  module DevisePasswordHistory
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_password_history
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 0.2.0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Heath
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2014-01-25 00:00:00 -05:00
18
+ date: 2014-10-15 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -24,14 +24,14 @@ dependencies:
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ~>
27
+ - - ">"
28
28
  - !ruby/object:Gem::Version
29
- hash: 7
29
+ hash: 15
30
30
  segments:
31
31
  - 2
32
- - 2
33
32
  - 0
34
- version: 2.2.0
33
+ - 0
34
+ version: 2.0.0
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  description: Maintains password history and ensures old passwords aren't reused