strongmind-auth 1.1.70 → 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,6 +75,10 @@ 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
83
|
Rails.cache.write(user.uid, session, expires_in: session[:expires_in].to_i.seconds - 10.minutes)
|
80
84
|
rescue PlatformSdk::Identity::ClientError => e
|