rails_jwt_auth 0.16.0 → 0.16.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0db8f2a0ef2121ee0f1c4f5ff80b11b1c4bdb8cc
4
- data.tar.gz: 6ffc4e0922ef4f7c228d2224e943030c06fa0e1d
3
+ metadata.gz: 435ef8af015612d0e47e0da192f83e26c0b4b1ee
4
+ data.tar.gz: 1d64fdd9773e51dc2ed90ed8972013d9a1443425
5
5
  SHA512:
6
- metadata.gz: 6533f3b2d2518403af392c6698c7193eb847bf3588c2d15387aed664362371fd0ef1410c3b7953bd358c5b77d3e641ad9bf62972e525546fec373284ff85d53c
7
- data.tar.gz: efca9a928a49a399d463bf0c7fc9e9ce617ab035f75670ec1bccd7e6be8825af271e31f167c5deacd563f09aa4eaa03f1e556e9ff5477ce116bd3ecd8a34abf6
6
+ metadata.gz: 4ab8e0205f858ded0cd2885a899bd125f33e642bc26c8e0b345c1b9b8673c86ad3483118820356bf59dcf7e1e43577dcd3bff14aafc486723dfcb0f64237a44b
7
+ data.tar.gz: a7e82544b16386c1366f2f1ae2ed782d29a31c91cac34269f8a7fa8677d5c273902597047ece1523e5fc8197c1156a9ab65078d9ca644b8f0c26339042152bd3
@@ -40,11 +40,22 @@ module RailsJwtAuth
40
40
  base.send(:field, :reset_password_sent_at, type: Time)
41
41
  end
42
42
 
43
+ base.send(:validate, :validate_reset_password_token, if: :password_digest_changed?)
44
+
43
45
  base.send(:before_update) do
44
46
  if password_digest_changed? && reset_password_token
45
47
  self.reset_password_token = nil
46
48
  end
47
49
  end
48
50
  end
51
+
52
+ private
53
+
54
+ def validate_reset_password_token
55
+ if reset_password_sent_at &&
56
+ (reset_password_sent_at < (Time.now - RailsJwtAuth.reset_password_expiration_time))
57
+ errors.add(:reset_password_token, I18n.t('rails_jwt_auth.errors.expired'))
58
+ end
59
+ end
49
60
  end
50
61
  end
@@ -1,3 +1,3 @@
1
1
  module RailsJwtAuth
2
- VERSION = '0.16.0'
2
+ VERSION = '0.16.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_jwt_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - rjurado
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-15 00:00:00.000000000 Z
11
+ date: 2017-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails