sync_attr_with_auth0 0.0.18 → 0.0.19
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/lib/sync_attr_with_auth0/model.rb +12 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 150f4f03236db891bc4d1282f1f80ebedbe40799
|
4
|
+
data.tar.gz: 8472efd778006cd84e1c49cef5e70a6ac03b5229
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
101
|
-
|
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
|
-
|
163
|
+
begin
|
164
|
+
response = auth0.patch_user(uid, args)
|
166
165
|
|
167
|
-
|
168
|
-
|
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
|
|