strongmind-auth 1.1.67 → 1.1.72
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: f1e3fd18ae6d5878a6429567c72e2d50553b364b31924b9f8788049c0d58a186
|
4
|
+
data.tar.gz: b30f49a52fe570523ebcf7d9a432240e35de4d98e30dd22d17ce0102621bf06f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28079c7c3ab3a185bfaa113417ef3f6ca08bb5c37b2c4f88496e948161f4a5826d89675e9b18babb161b9cdf16e9d9e3930f691578d3c11c27cfbeb1607bfc07
|
7
|
+
data.tar.gz: c15fd8c8a595ef35c308d103801015621f4c341e1725c3f90e99a4e42aaba3360a3ffdff85d006e8d63293a2c1651f4195bd8101f891b91c2c8680cf00d26573
|
@@ -11,7 +11,7 @@ module StrongMindNav
|
|
11
11
|
@top_navbar_html = navbar[:top_navbar_html]
|
12
12
|
@bottom_navbar_html = navbar[:bottom_navbar_html]
|
13
13
|
@theme_css = navbar[:theme_css]
|
14
|
-
rescue Strongmind::Exceptions::TokenNotFoundError, Strongmind::Exceptions::UserNotFoundError, Strongmind::Exceptions::RefreshTokenExpiredError => e
|
14
|
+
rescue Strongmind::Exceptions::NilSessionError, Strongmind::Exceptions::TokenNotFoundError, Strongmind::Exceptions::UserNotFoundError, Strongmind::Exceptions::RefreshTokenExpiredError => e
|
15
15
|
Sentry.capture_exception(e)
|
16
16
|
Rails.logger.error(e)
|
17
17
|
flash[:alert] = e.inspect if Rails.env.development? || Rails.env.test?
|
@@ -48,8 +48,8 @@ module Strongmind
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def fetch_navbar_data(nav_items)
|
51
|
-
access_token = token
|
52
51
|
refresh_session
|
52
|
+
access_token = token
|
53
53
|
|
54
54
|
connection.post(navbar_endpoint, nav_items.to_json, 'Authorization' => "Bearer #{access_token}")
|
55
55
|
end
|
@@ -75,8 +75,12 @@ module Strongmind
|
|
75
75
|
|
76
76
|
def refresh_session
|
77
77
|
session = Rails.cache.fetch(user.uid)
|
78
|
+
unless session&.key?(:access_token)
|
79
|
+
raise Strongmind::Exceptions::NilSessionError, "Session not found for user #{user.uid}"
|
80
|
+
end
|
81
|
+
|
78
82
|
auth_client.refresh_session(session:)
|
79
|
-
Rails.cache.write(user.uid, session)
|
83
|
+
Rails.cache.write(user.uid, session, expires_in: session[:expires_in].to_i.seconds - 10.minutes)
|
80
84
|
rescue PlatformSdk::Identity::ClientError => e
|
81
85
|
handle_refresh_error(e)
|
82
86
|
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.
|
4
|
+
version: 1.1.72
|
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-04-
|
11
|
+
date: 2024-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|