rails_jwt_auth 1.0.2 → 1.1.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.
- checksums.yaml +4 -4
- data/app/models/concerns/rails_jwt_auth/authenticatable.rb +11 -10
- data/lib/rails_jwt_auth/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1cf5f9e135d2a39af71b620311285fdc6101de29a3e6481f54ca78551ca1a23
|
4
|
+
data.tar.gz: 45c733d715e884419e4d1174c83ea64d9f706e0449c7e652a18a3e57718b2967
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af13c3b614e7263432c61eda040d619ace560a87fc409caa74a1d8c396bf6747790bc855ba5ce6b3167e0d84fef48692340f3b71f6eb78859e0012c657e3a977
|
7
|
+
data.tar.gz: 8017970563305ab55b8cd59c151f35093fac4c49d92bf60e51ddb794d3d695dd3f6a188811078942ca74c9689d3faf30b8af5d85fbe421c4c5aade60279f3c10
|
@@ -40,19 +40,20 @@ module RailsJwtAuth
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def update_with_password(params)
|
43
|
-
if (current_password = params.delete(:current_password)).blank?
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
current_password_error = if (current_password = params.delete(:current_password)).blank?
|
44
|
+
'blank'
|
45
|
+
elsif !authenticate(current_password)
|
46
|
+
'invalid'
|
47
|
+
end
|
48
48
|
|
49
|
-
if
|
50
|
-
|
51
|
-
end
|
49
|
+
# abort reset password if exists to allow save
|
50
|
+
self.reset_password_token = self.reset_password_sent_at = nil if reset_password_token
|
52
51
|
|
53
|
-
params
|
52
|
+
assign_attributes(params)
|
53
|
+
valid? # validates first other fields
|
54
|
+
errors.add(:current_password, current_password_error) if current_password_error
|
54
55
|
|
55
|
-
errors.empty? ?
|
56
|
+
errors.empty? ? save : false
|
56
57
|
end
|
57
58
|
|
58
59
|
def to_token_payload(_request=nil)
|
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: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rjurado
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bcrypt
|