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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d187d5804082b937eb593a7e6097057531cf701cd5f5d6ca5c5e204e70a74ac6
4
- data.tar.gz: 0ea33f4dfe029e0adca678d1a5c0da5a4cacdce1757c0b7a80c7680f6d3bd4a5
3
+ metadata.gz: e28c44ee15358c2cd005c765701a0bae728a8f731a26bd983cc89b98f22f93a0
4
+ data.tar.gz: f9002365819bfc3cb943d6b432406d4aaf8c0874bf661abff9f86ffda05727a7
5
5
  SHA512:
6
- metadata.gz: 697183d85bc8ef2a0a338b9d553a822972f59bf84bebb2b2da233f8507be0226726ff87e0da2de6ac7a8f33c418297f2b73b7ebdf5d0c1cb5c5457fc281a2d2c
7
- data.tar.gz: 1254bc1891abbfe7b4ab360a552d9c5c27bd6564096ac412daa5a3167c8f4a65e0d074e0d8818bc8ec35113bdd302aa738400d6fc68f3a4f9104554185f5fdfc
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
- "user_#{current_user.uid}_#{current_user.selected_role_id}_#{navbar_options_cache_key}_navbar"
83
+ role = "role_#{current_user.selected_role_id}"
84
+
85
+ [session_token, user, role, navbar_options_cache_key, 'navbar'].join('_')
83
86
  else
84
- "user_#{current_user.uid}_#{navbar_options_cache_key}_navbar"
87
+ [session_token, user, navbar_options_cache_key, 'navbar'].join('_')
85
88
  end
86
89
 
87
90
  Digest::SHA256.hexdigest(user_cache_key)
@@ -1,5 +1,5 @@
1
1
  module Strongmind
2
2
  module Auth
3
- VERSION = "1.1.102"
3
+ VERSION = "1.1.104"
4
4
  end
5
5
  end
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.102
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-12 00:00:00.000000000 Z
11
+ date: 2024-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails