strongmind-auth 1.1.102 → 1.1.104
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/strong_mind_nav.rb +7 -4
- data/lib/strongmind/auth/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e28c44ee15358c2cd005c765701a0bae728a8f731a26bd983cc89b98f22f93a0
|
4
|
+
data.tar.gz: f9002365819bfc3cb943d6b432406d4aaf8c0874bf661abff9f86ffda05727a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4105b0026dab50a2394d3bdbd788bb4bb921fe268670b2a4020688568dbb34d02a47c4fc32ddea6c7aea8600226a3dc6fd1c7090d3e11f9b80730caf4f6c1036
|
7
|
+
data.tar.gz: 0dbc0726df726ff5ae0baf5e1c6e3548d55b239f9da13ef48a248f4ffc16e24b267656a973a2572954d92bc982b09ae452a3ae8b9cde0ce5afe2370f33e02a8d
|
@@ -9,8 +9,7 @@ module StrongMindNav
|
|
9
9
|
nav_items = build_nav_items
|
10
10
|
|
11
11
|
user_cache_key_encoded = generate_user_cache_key(nav_items)
|
12
|
-
|
13
|
-
navbar = Rails.cache.fetch(user_cache_key_encoded, expires_in: 1.day) do
|
12
|
+
navbar = Rails.cache.fetch(user_cache_key_encoded, expires_in: 30.seconds) do
|
14
13
|
Strongmind::CommonNavFetcher.new(current_user).retrieve(nav_items, common_nav_options)
|
15
14
|
end
|
16
15
|
|
@@ -77,11 +76,15 @@ module StrongMindNav
|
|
77
76
|
|
78
77
|
def generate_user_cache_key(nav_items)
|
79
78
|
navbar_options_cache_key = nav_items.to_json
|
79
|
+
session_token = session[:_csrf_token]
|
80
|
+
user = "user_#{current_user.uid}"
|
80
81
|
|
81
82
|
user_cache_key = if current_user.respond_to?(:selected_role_id)
|
82
|
-
"
|
83
|
+
role = "role_#{current_user.selected_role_id}"
|
84
|
+
|
85
|
+
[session_token, user, role, navbar_options_cache_key, 'navbar'].join('_')
|
83
86
|
else
|
84
|
-
|
87
|
+
[session_token, user, navbar_options_cache_key, 'navbar'].join('_')
|
85
88
|
end
|
86
89
|
|
87
90
|
Digest::SHA256.hexdigest(user_cache_key)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strongmind-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.104
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Team Belding
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|