sync_attr_with_auth0 0.1.9 → 0.2.0

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: aedcc6948282cf1dce296ad604f0cd804a9ff24b
4
- data.tar.gz: 07cb15e12ab2849fd05ea5274cfbcb4f4828b378
3
+ metadata.gz: 1e695e69af87911aabd00b8ce843ff282d0f0d37
4
+ data.tar.gz: 7a5e2e80105e3f3317e745c6ea35e5003242790e
5
5
  SHA512:
6
- metadata.gz: 2830aaa236835e9f1e0222df41af6730cf53c3c2d8286b28fd1ce097e1648e437a1bd99d51728c5f8d3ce58901fea343f6db9a830b9d6fe168c724c85fd879ef
7
- data.tar.gz: 185033676a75cd961d12d5f951072da2352541689a109e0b93622059bd4ca670a64ac026d395c40595e6c3f2d5d1bf1cb0717685981563d06e5c5e5100125d5f
6
+ metadata.gz: 91d27a3269ffcfc3caf0b6897db9623646ac659484ef8e722f10af27f976b12fef5e041511579283bca3f313431fa19bb74b125b75b421a3274ac5653106b0c6
7
+ data.tar.gz: 1cb8629ac16d9c752836d9c2c9a9ecef56b2574b35a9c1e7ace3dfe00e83dc607d8a9067f83eaf21863f5a67ec685ac8fe0aa6487a484392b62f944704351186
@@ -68,7 +68,15 @@ module SyncAttrWithAuth0
68
68
  auth0 = SyncAttrWithAuth0::Auth0.create_auth0_client(config: config)
69
69
 
70
70
  # Use the Lucene search because Find by Email is case sensitive
71
- results = auth0.get('/api/v2/users', q: "email:#{email}")
71
+ query = "email:#{email}"
72
+ unless config.search_connections.empty?
73
+ conn_query = config.search_connections
74
+ .collect { |conn| %Q{identities.connection:"#{conn}"} }
75
+ .join ' OR '
76
+ query = "#{query} AND (#{conn_query})"
77
+ end
78
+
79
+ results = auth0.get('/api/v2/users', q: query, search_engine: 'v3')
72
80
 
73
81
  if exclude_user_id
74
82
  results = results.reject { |r| r['user_id'] == exclude_user_id }
@@ -32,7 +32,7 @@ module SyncAttrWithAuth0
32
32
  :auth0_uid_attribute, :name_attribute, :given_name_attribute,
33
33
  :family_name_attribute, :email_attribute, :password_attribute,
34
34
  :email_verified_attribute, :verify_password_attribute, :picture_attribute,
35
- :connection_name
35
+ :connection_name, :search_connections
36
36
 
37
37
 
38
38
  def initialize
@@ -52,6 +52,7 @@ module SyncAttrWithAuth0
52
52
  @verify_password_attribute = :verify_password
53
53
  @picture_attribute = :picture
54
54
  @connection_name = 'Username-Password-Authentication'
55
+ @search_connections = []
55
56
  end
56
57
  end
57
58
  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.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick McGraw