oauth_im 0.12.1 → 0.13.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21c49f432ffef807fecc90eb4e676bdb8ca1aba6523eaf82421d817f519f4eac
|
4
|
+
data.tar.gz: 5bc900d0b0227686df48bf2ae06fd1517c5376d5e5f6bf265d8894b87fad0d37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 577dda1cad914c4f3013834f6e674ef6476624347af8a3aab91dae76ecf3e4dd6403e4edd78cecfd06161d0f96d29fb80da26921f233947264238bef49f54711
|
7
|
+
data.tar.gz: 4d778e7f5800e8b33f9d55fb90b890c34002d9b5619c53a337612e7bd10a1796644b962e446ce9426248d47e629ae8de2591022232930e0223dade039fb26273
|
@@ -4,9 +4,14 @@ require 'oauth2'
|
|
4
4
|
|
5
5
|
module OauthIm
|
6
6
|
class ClientController < OauthIm::ApplicationController
|
7
|
+
delegate :oauth_rescue_redirect_path, to: :configuration
|
8
|
+
|
7
9
|
def callback
|
8
10
|
session[:user_jwt] = user_jwt
|
9
11
|
redirect_to main_app.root_path
|
12
|
+
rescue StandardError => e
|
13
|
+
Rollbar.warning "rescue OauthIm::ClientController#callback: #{request.original_url} #{e.message}"
|
14
|
+
redirect_to oauth_rescue_redirect_path
|
10
15
|
end
|
11
16
|
|
12
17
|
def login
|
@@ -4,17 +4,11 @@ require 'fusionauth/fusionauth_client'
|
|
4
4
|
|
5
5
|
module OauthIm
|
6
6
|
class AdminClient < IdpClient
|
7
|
-
def search_for(term: '', email: '', limit: 25, offset: 0)
|
7
|
+
def search_for(term: '', email: '', query: nil, limit: 25, offset: 0)
|
8
8
|
if email.present?
|
9
9
|
proxy_users_for client.retrieve_user_by_email(email)
|
10
|
-
elsif term.present?
|
11
|
-
|
12
|
-
search: {
|
13
|
-
numberOfResults: limit,
|
14
|
-
queryString: term,
|
15
|
-
startRow: offset
|
16
|
-
}
|
17
|
-
)
|
10
|
+
elsif term.present? || query.present?
|
11
|
+
search term: term, query: query, limit: limit, offset: offset
|
18
12
|
else
|
19
13
|
[]
|
20
14
|
end
|
@@ -43,5 +37,22 @@ module OauthIm
|
|
43
37
|
def proxy_users_for(response)
|
44
38
|
user_attrs_for(response).map { |attrs| ProxyUser.new(attrs) }
|
45
39
|
end
|
40
|
+
|
41
|
+
def search(term:, query:, limit:, offset:)
|
42
|
+
proxy_users_for client.search_users_by_query(
|
43
|
+
search: search_params(
|
44
|
+
term: term, query: query, limit: limit, offset: offset
|
45
|
+
)
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
def search_params(term:, query:, limit:, offset:)
|
50
|
+
{
|
51
|
+
numberOfResults: limit,
|
52
|
+
startRow: offset,
|
53
|
+
queryString: term,
|
54
|
+
query: query&.to_json
|
55
|
+
}.reject { |_key, val| val.blank? }
|
56
|
+
end
|
46
57
|
end
|
47
58
|
end
|
data/lib/oauth_im/version.rb
CHANGED