strongmind-auth 1.1.86 → 1.1.87
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: 68d4f820dabda4457f35f915c07b4bc6c1c8b38549cd1b69e9a14d8a6697cad7
|
4
|
+
data.tar.gz: 1efa85b966114ed8e9550e145101bfcdb1a8b6823797b965caddce8838805dbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e718fffd7528f4a2c2581e5d43b179d0ea365bcea5604b2a83876740e29034282e4ab26b51425844fdbb752bab4d4a9cacb0a8cfc6208de964cb6e35486a10c1
|
7
|
+
data.tar.gz: 001fc752ef39f9d961ff99eca8ea7137a58121212a77d34504cf2c0c265060fd0f886de789872726100e93d2795f58b562ca4d5ae6d978955f61fc4f5d0638ad
|
@@ -6,8 +6,7 @@ module StrongMindNav
|
|
6
6
|
|
7
7
|
def fetch_common_nav
|
8
8
|
begin
|
9
|
-
|
10
|
-
navbar = Strongmind::CommonNavFetcher.new(current_user, request).retrieve(menu_items, authenticity_token)
|
9
|
+
navbar = Strongmind::CommonNavFetcher.new(current_user, request).retrieve(common_nav_options)
|
11
10
|
|
12
11
|
@top_navbar_html = navbar[:top_navbar_html]
|
13
12
|
@bottom_navbar_html = navbar[:bottom_navbar_html]
|
@@ -32,4 +31,11 @@ module StrongMindNav
|
|
32
31
|
]
|
33
32
|
end
|
34
33
|
|
34
|
+
def common_nav_options
|
35
|
+
{
|
36
|
+
menu_items: menu_items,
|
37
|
+
authenticity_token: form_authenticity_token,
|
38
|
+
show_role_switcher: false
|
39
|
+
}
|
40
|
+
end
|
35
41
|
end
|
@@ -27,8 +27,8 @@ module Strongmind
|
|
27
27
|
)
|
28
28
|
end
|
29
29
|
|
30
|
-
def retrieve(
|
31
|
-
response = fetch_navbar_data(build_nav_items(menu_items),
|
30
|
+
def retrieve(nav_options)
|
31
|
+
response = fetch_navbar_data(build_nav_items(nav_options[:menu_items]), nav_options)
|
32
32
|
parse_navbar(response)
|
33
33
|
end
|
34
34
|
|
@@ -47,11 +47,11 @@ module Strongmind
|
|
47
47
|
path_to_compare.include?(sanitized_path) || path_to_compare.include?(sanitized_path.pluralize)
|
48
48
|
end
|
49
49
|
|
50
|
-
def fetch_navbar_data(nav_items,
|
50
|
+
def fetch_navbar_data(nav_items, nav_options)
|
51
51
|
session = refresh_session
|
52
52
|
access_token = session[:access_token]
|
53
53
|
|
54
|
-
payload = nav_items.merge(authenticity_token: ).to_json
|
54
|
+
payload = nav_items.merge({ authenticity_token: nav_options[:authenticity_token], show_role_switcher: nav_options[:show_role_switcher] }).to_json
|
55
55
|
connection.post(navbar_endpoint, payload, 'Authorization' => "Bearer #{access_token}")
|
56
56
|
end
|
57
57
|
|