sync_attr_with_auth0 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sync_attr_with_auth0/model.rb +14 -0
- 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: 0b4c90d565c0bcaf4fa8b929320b0aa1a5c066e6
|
4
|
+
data.tar.gz: fde7fe0f1445c8c7dcdd4a842e81edc4f041ae8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1aeec3b8019ebcd2593eeae4c0a87b794d2e7cfac906c15e6dfb1721695e5ccc1cb6bcaafc363e41c5fca82bd155e9ca711c6a8e68b0a7bda85e03201b2656c
|
7
|
+
data.tar.gz: f321cc9825122ab90ac486d169525199ae14d010d0cb932a1cc50146294f010d99748af9761ae3c97e0cd5c1df294c302140b28d6613d0f73f6cd6801425602f
|
@@ -27,6 +27,7 @@ module SyncAttrWithAuth0
|
|
27
27
|
email_att: :email,
|
28
28
|
password_att: :password,
|
29
29
|
email_verified_att: :email_verified,
|
30
|
+
verify_password_att: :verify_password,
|
30
31
|
connection_name: 'Username-Password-Authentication',
|
31
32
|
sync_atts: []
|
32
33
|
}
|
@@ -113,6 +114,15 @@ module SyncAttrWithAuth0
|
|
113
114
|
}
|
114
115
|
}
|
115
116
|
|
117
|
+
if (
|
118
|
+
auth0_sync_options[:sync_atts].index(auth0_sync_options[:password_att]) and
|
119
|
+
self.send("#{auth0_sync_options[:password_att]}_changed?")
|
120
|
+
)
|
121
|
+
# The password should be sync'd and was changed
|
122
|
+
args['password'] = self.send(auth0_sync_options[:password_att])
|
123
|
+
args['verify_password'] = auth0_verify_password?
|
124
|
+
end
|
125
|
+
|
116
126
|
args['user_metadata'] = user_metadata
|
117
127
|
|
118
128
|
response = auth0.patch_user(uid, args)
|
@@ -131,6 +141,10 @@ module SyncAttrWithAuth0
|
|
131
141
|
!!(self.respond_to?(auth0_sync_options[:email_verified_att]) ? self.send(auth0_sync_options[:email_verified_att]) : false)
|
132
142
|
end
|
133
143
|
|
144
|
+
def auth0_verify_password?
|
145
|
+
!!(self.respond_to?(auth0_sync_options[:verify_password_att]) ? self.send(auth0_sync_options[:verify_password_att]) : true)
|
146
|
+
end
|
147
|
+
|
134
148
|
def auth0_default_password
|
135
149
|
# Need a9 or something similar to guarantee one letter and one number in the password
|
136
150
|
"#{auth0_new_uuid[0..19]}a9"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sync_attr_with_auth0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick McGraw
|
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
166
|
version: '0'
|
167
167
|
requirements: []
|
168
168
|
rubyforge_project:
|
169
|
-
rubygems_version: 2.
|
169
|
+
rubygems_version: 2.2.2
|
170
170
|
signing_key:
|
171
171
|
specification_version: 4
|
172
172
|
summary: Synchronize attributes on a local ActiveRecord user model with the user metadata
|