sync_attr_with_auth0 0.0.23 → 0.0.24

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: a2bf2d9667067ee4ddf2b3a0f6984d4f6dbd1718
4
- data.tar.gz: 2987a1a6425a37450e8f23f853ab651c9fa1d289
3
+ metadata.gz: a7e91115c9447ecd2b8c612d2148904259669f0a
4
+ data.tar.gz: fb061ecdefe8d8abffe3a05bdbcc8eb21c355ace
5
5
  SHA512:
6
- metadata.gz: acbe5201cad579b763012e6e72f1916f9465ff7c31d82857887e01ac57778685bd553f8239bc6d325bac879c9a20458c73df05295c072300ab915bdc8c7a49c3
7
- data.tar.gz: 502b60f1108226edb88c752139b8ecda5816e28109b563d616d33444b7b9c840f99fb28cfc10a43c7ceab2ab5775c044430cb358082af3f022bb8c533c503dd3
6
+ metadata.gz: 8e347c8c400a52ed35192e00452f808ffdc86c5efdd4894eafba59a9f135cc4b56fc7d2fdd1b03bdfc2faaf26f1f60ae05bf2e92978294516d9ec855970ab026
7
+ data.tar.gz: 0b0b318a9e8abd32793cc6c6eec261427e5f04abf2a812e73fac837498da67a300493be6c5c1b403aa284b85e15b9a9fc9cf8cb236bd1423771b0d59876e670f
@@ -171,6 +171,15 @@ module SyncAttrWithAuth0
171
171
  args['verify_password'] = auth0_verify_password?
172
172
  end
173
173
 
174
+ if (
175
+ auth0_sync_options[:sync_atts].index(auth0_sync_options[:email_att]) and
176
+ auth0_email_changed?
177
+ )
178
+ # The email should be sync'd and was changed
179
+ args['email'] = self.send(auth0_sync_options[:email_att])
180
+ args['verify_email'] = auth0_email_verified?
181
+ end
182
+
174
183
  args['user_metadata'] = user_metadata
175
184
 
176
185
  begin
@@ -230,6 +239,10 @@ module SyncAttrWithAuth0
230
239
  !!(self.respond_to?(auth0_sync_options[:email_verified_att]) ? self.send(auth0_sync_options[:email_verified_att]) : false)
231
240
  end
232
241
 
242
+ def auth0_email_changed?
243
+ !!(self.respond_to?(auth0_sync_options[:email_att]) ? self.send("#{auth0_sync_options[:email_att]}_changed?") : false)
244
+ end
245
+
233
246
  def auth0_verify_password?
234
247
  !!(self.respond_to?(auth0_sync_options[:verify_password_att]) ? self.send(auth0_sync_options[:verify_password_att]) : true)
235
248
  end
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.23
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick McGraw
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  version: '0'
168
168
  requirements: []
169
169
  rubyforge_project:
170
- rubygems_version: 2.4.6
170
+ rubygems_version: 2.4.5
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: Synchronize attributes on a local ActiveRecord user model with the user metadata