sync_attr_with_auth0 0.1.4 → 0.1.5

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: b06a96e75b195fedf43d7641e9ee738b47b21da6
4
- data.tar.gz: 80db7d6bd23e9ce80434547a67eeac3515d5f320
3
+ metadata.gz: a5457dfb8a1932697e839945d0844bb185d4080d
4
+ data.tar.gz: d2f4db8ed0e24103f4eedb1fa9277466c6bbcf92
5
5
  SHA512:
6
- metadata.gz: 8827c50048a03353a121a8f5ab4bc72516190b1aac22ae8de08f2ff2a127fa04bb8606f3c4499504e4952016099f93390bbc1ee15038dd0e5015929762304b61
7
- data.tar.gz: 563778c38a2280eb43e9aafaf01081324b67821f389b398d288dcd74d96656cca4791fa8ddf49a771ab62bcbba1e679c0c6ab3cb0f6e790e8204b594960155ff
6
+ metadata.gz: 1afbc06542e3f595b53634ffe798d44c3cf616c1dd71a4bd23a16c22eb1b7053d0ad1d138ca84c172d552041fc1a57e3cde48b8f0ffd9557312ce6bb5b52112a
7
+ data.tar.gz: f6990fce1f91778643f3d50c002e39ad6d432577c340f6b23f5b12f718173ba80284b44949aaf2da853451d5573abffc790840dbc4a2e8452221d5453789dc2f
@@ -66,13 +66,14 @@ module SyncAttrWithAuth0
66
66
 
67
67
  def self.find_users_by_email(email, exclude_user_id: nil, config: SyncAttrWithAuth0.configuration)
68
68
  auth0 = SyncAttrWithAuth0::Auth0.create_auth0_client(config: config)
69
- query_string = "email:\"#{email}\""
70
69
 
71
- unless exclude_user_id.nil?
72
- query_string += " -user_id:\"#{exclude_user_id}\""
70
+ results = auth0.get('/api/v2/users-by-email', email: email)
71
+
72
+ if exclude_user_id
73
+ results = results.reject { |r| r['user_id'] == exclude_user_id }
73
74
  end
74
75
 
75
- return auth0.users(q: query_string)
76
+ return results
76
77
  end # ::find_users_by_email
77
78
 
78
79
 
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.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick McGraw
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  version: '0'
171
171
  requirements: []
172
172
  rubyforge_project:
173
- rubygems_version: 2.6.8
173
+ rubygems_version: 2.6.13
174
174
  signing_key:
175
175
  specification_version: 4
176
176
  summary: Synchronize attributes on a local ActiveRecord user model with the user metadata