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 +4 -4
- data/app/models/concerns/rails_jwt_auth/recoverable.rb +11 -0
- data/lib/rails_jwt_auth/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 435ef8af015612d0e47e0da192f83e26c0b4b1ee
|
4
|
+
data.tar.gz: 1d64fdd9773e51dc2ed90ed8972013d9a1443425
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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-
|
11
|
+
date: 2017-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|