sync_attr_with_auth0 0.0.18 → 0.0.19

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: 1349703e7bb7429f17470b43f1bb8d9f8991f59f
4
- data.tar.gz: 0a2de574896e0cd1505c1fcc9641fdedc906d2e2
3
+ metadata.gz: 150f4f03236db891bc4d1282f1f80ebedbe40799
4
+ data.tar.gz: 8472efd778006cd84e1c49cef5e70a6ac03b5229
5
5
  SHA512:
6
- metadata.gz: 1ac3a2fdf6a6530d79668202a629ad60cabdd44a290c4067b4a039f576c2a354eff6fb1c6b66b5420e52fee91d3c3cb97d83d525b63d7a0d06a59853f294d0d9
7
- data.tar.gz: e620c9046049335bc937e3deb0a5f0d457a3a1331a2c9558c2a47d361231237ddf2c06cb0670065c37d54784e268a4f230b9aae6c3602ea288f0498b179cff25
6
+ metadata.gz: 615714c6687b570fe7d11b3ff45a7ed75f12d128dc93567f5c0697dc8c030f6d9ebb5b19eca47f51ea0e65b7f1dad4de1d792ad07dd754b25d3d9935ddcaa1b6
7
+ data.tar.gz: 6048ab73ee2eb08455ec72d5f2da74ff9766bab860bb99197c63c1d08efbbee4ff0685af739e08bb66ee133f5c18f9add09630d5f11191983cd4c3b790d11693
@@ -97,10 +97,8 @@ module SyncAttrWithAuth0
97
97
  # Get the auth0 uid
98
98
  uid = self.send(auth0_sync_options[:uid_att])
99
99
 
100
- if uid.nil?
101
- # Create the user in auth0
102
- create_user_in_auth0
103
- else
100
+ # TODO: create a user if the uid is nil
101
+ unless uid.nil?
104
102
  # Update the user in auth0
105
103
  update_user_in_auth0
106
104
  end
@@ -162,10 +160,17 @@ module SyncAttrWithAuth0
162
160
 
163
161
  args['user_metadata'] = user_metadata
164
162
 
165
- response = auth0.patch_user(uid, args)
163
+ begin
164
+ response = auth0.patch_user(uid, args)
166
165
 
167
- if response.code == 404
168
- create_user_in_auth0
166
+ rescue ::Auth0::NotFound => e
167
+ # TODO: We need to attempt to find the correct UID by email or nil the UID on the user.
168
+
169
+ rescue Exception => e
170
+ ::Rails.logger.error e.message
171
+ ::Rails.logger.error e.backtrace.join("\n")
172
+
173
+ raise e
169
174
  end
170
175
  end
171
176
 
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.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick McGraw