rails_jwt_auth 1.6.0 → 1.6.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a366c8d045f041a81ddb16e375a052f19dc011038d408c79dde19c31e6696968
|
4
|
+
data.tar.gz: eafb8cf07deb41c01bf719fda8e66b2b5e6d8cc620bdc418dbd8ffa9d6f55ba1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a29adeb02a5e05ad95773eccdedbdeb53649f5e493c23e16a65541ac8191f39532308faed100866ab6c79ded869b6476e99dbac4257f27c27a5dbb920d31f71
|
7
|
+
data.tar.gz: 39d19de7185410e1e8ecdcadaa13674a9ef520e3a0f91edeb883dddd43aa1ca3ed72187a810df475f20004f572a39796c27ebe4d815fa3f12791473d4f1696f4
|
@@ -17,7 +17,7 @@ module RailsJwtAuth
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def password_create_params
|
20
|
-
params.require(:password).permit(
|
20
|
+
params.require(:password).permit(RailsJwtAuth.email_field_name)
|
21
21
|
end
|
22
22
|
|
23
23
|
def password_update_params
|
@@ -25,7 +25,7 @@ module RailsJwtAuth
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def invitation_create_params
|
28
|
-
params.require(:invitation).permit(
|
28
|
+
params.require(:invitation).permit(RailsJwtAuth.email_field_name)
|
29
29
|
end
|
30
30
|
|
31
31
|
def invitation_update_params
|
@@ -4,13 +4,17 @@ module RailsJwtAuth
|
|
4
4
|
include RenderHelper
|
5
5
|
|
6
6
|
def create
|
7
|
-
|
7
|
+
email_field = RailsJwtAuth.email_field_name
|
8
|
+
|
9
|
+
if password_create_params[email_field].blank?
|
10
|
+
return render_422(email_field => [{error: :blank}])
|
11
|
+
end
|
8
12
|
|
9
13
|
user = RailsJwtAuth.model.where(
|
10
|
-
|
14
|
+
email_field => password_create_params[email_field].to_s.strip.downcase
|
11
15
|
).first
|
12
16
|
|
13
|
-
return render_422(
|
17
|
+
return render_422(email_field => [{error: :not_found}]) unless user
|
14
18
|
|
15
19
|
user.send_reset_password_instructions ? render_204 : render_422(user.errors.details)
|
16
20
|
end
|
@@ -72,9 +72,15 @@ module RailsJwtAuth
|
|
72
72
|
self.confirmation_token = nil
|
73
73
|
|
74
74
|
if unconfirmed_email
|
75
|
-
|
76
|
-
|
75
|
+
email_field = RailsJwtAuth.email_field_name!
|
76
|
+
|
77
|
+
self[email_field] = unconfirmed_email
|
77
78
|
self.unconfirmed_email = nil
|
79
|
+
|
80
|
+
# supports email confirmation attr_accessor validation
|
81
|
+
if respond_to?("#{email_field}_confirmation")
|
82
|
+
self.instance_variable_set("@#{email_field}_confirmation", self[email_field])
|
83
|
+
end
|
78
84
|
end
|
79
85
|
|
80
86
|
save
|
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.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rjurado
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bcrypt
|