sync_attr_with_auth0 0.1.9 → 0.2.0
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/auth0.rb +9 -1
- data/lib/sync_attr_with_auth0/configuration.rb +2 -1
- 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: 1e695e69af87911aabd00b8ce843ff282d0f0d37
|
4
|
+
data.tar.gz: 7a5e2e80105e3f3317e745c6ea35e5003242790e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|