sync_attr_with_auth0 0.0.20 → 0.0.21
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 +7 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e79727fa97e9f637b4e9922291ebb92de96d0678
|
4
|
+
data.tar.gz: 9e5c0a922d5d3b8a3f15b5da66f98090978d56d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe728e2b3be857226ededc06b5f42b6b1161a4cfed6732e599ddda97664f73c94b2a2d3743b858a2a8e5a7c2cd55cc21d23bf2a0318220054193f4d6bd55e06e
|
7
|
+
data.tar.gz: de2c6b0565dbb707f68894e3207d65661b9fa2a17cb5bd1c67da92de48d465bc969b547d441a04b59fddf6b4ec60802785c5707dad7c9e64e5af8f6c3498cda9
|
@@ -14,7 +14,7 @@ module SyncAttrWithAuth0
|
|
14
14
|
|
15
15
|
after_validation :validate_email_with_auth0
|
16
16
|
after_create :auth0_create
|
17
|
-
after_update :auth0_update
|
17
|
+
after_update :auth0_update, if: :auth0_dirty?
|
18
18
|
end
|
19
19
|
|
20
20
|
private
|
@@ -167,7 +167,6 @@ module SyncAttrWithAuth0
|
|
167
167
|
auth0.patch_user(uid, args)
|
168
168
|
|
169
169
|
rescue ::Auth0::NotFound => e
|
170
|
-
# TODO: We need to attempt to find the correct UID by email or nil the UID on the user.
|
171
170
|
response = find_user_in_auth0
|
172
171
|
found_user = response.first
|
173
172
|
|
@@ -234,5 +233,11 @@ module SyncAttrWithAuth0
|
|
234
233
|
return user_metadata
|
235
234
|
end
|
236
235
|
|
236
|
+
def auth0_dirty?
|
237
|
+
!!(auth0_sync_options[:sync_atts].inject(false) do |memo, attrib|
|
238
|
+
memo || try("#{attrib}_changed?")
|
239
|
+
end)
|
240
|
+
end
|
241
|
+
|
237
242
|
end
|
238
243
|
end
|
metadata
CHANGED
@@ -1,10 +1,11 @@
|
|
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.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick McGraw
|
8
|
+
- Mike Oliver
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
@@ -166,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
167
|
version: '0'
|
167
168
|
requirements: []
|
168
169
|
rubyforge_project:
|
169
|
-
rubygems_version: 2.4.
|
170
|
+
rubygems_version: 2.4.5
|
170
171
|
signing_key:
|
171
172
|
specification_version: 4
|
172
173
|
summary: Synchronize attributes on a local ActiveRecord user model with the user metadata
|