oidc-jwt-client
Advanced tools
Comparing version 4.0.18-develop.6 to 4.0.18-develop.7
@@ -60,2 +60,3 @@ 'use strict'; | ||
var didRetryLogin = OidcJwtProvider.useOidcJwtStore(function (state) { return state.authState.didRetryLogin; }); | ||
var isInitialized = OidcJwtProvider.useOidcJwtStore(function (state) { return state.authState.isInitialized; }); | ||
var isPrevLoggedIn = reactUse.usePrevious(isLoggedIn); | ||
@@ -79,6 +80,6 @@ var _a = React.useState(false), isSessionExpired = _a[0], setSessionExpired = _a[1]; | ||
*/ | ||
if (didRetryLogin) { | ||
if (didRetryLogin && isInitialized) { | ||
checkSessionExpired(); | ||
} | ||
}, [checkSessionExpired, didRetryLogin]); | ||
}, [checkSessionExpired, didRetryLogin, isInitialized]); | ||
React.useEffect(function () { | ||
@@ -91,3 +92,3 @@ var isFirstSessionExpired = Boolean(!isLoggedIn && isPrevLoggedIn); | ||
*/ | ||
if (!isSessionExpired && !didRetryLogin && isFirstSessionExpired) { | ||
if (!isSessionExpired && !didRetryLogin && isFirstSessionExpired && isInitialized) { | ||
authService === null || authService === void 0 ? void 0 : authService.authorize({ prompt: 'none' }, { isRetrying: true }); | ||
@@ -102,2 +103,3 @@ } | ||
authService, | ||
isInitialized, | ||
]); | ||
@@ -104,0 +106,0 @@ return isSessionExpired; |
@@ -12,3 +12,3 @@ 'use strict'; | ||
isLoggedIn: false, | ||
isInitialized: !client, | ||
isInitialized: false, | ||
didRetryLogin: false, | ||
@@ -15,0 +15,0 @@ }; |
@@ -58,2 +58,3 @@ import { __awaiter, __generator } from './node_modules/tslib/tslib.es6.js'; | ||
var didRetryLogin = useOidcJwtStore(function (state) { return state.authState.didRetryLogin; }); | ||
var isInitialized = useOidcJwtStore(function (state) { return state.authState.isInitialized; }); | ||
var isPrevLoggedIn = usePrevious(isLoggedIn); | ||
@@ -77,6 +78,6 @@ var _a = useState(false), isSessionExpired = _a[0], setSessionExpired = _a[1]; | ||
*/ | ||
if (didRetryLogin) { | ||
if (didRetryLogin && isInitialized) { | ||
checkSessionExpired(); | ||
} | ||
}, [checkSessionExpired, didRetryLogin]); | ||
}, [checkSessionExpired, didRetryLogin, isInitialized]); | ||
useEffect(function () { | ||
@@ -89,3 +90,3 @@ var isFirstSessionExpired = Boolean(!isLoggedIn && isPrevLoggedIn); | ||
*/ | ||
if (!isSessionExpired && !didRetryLogin && isFirstSessionExpired) { | ||
if (!isSessionExpired && !didRetryLogin && isFirstSessionExpired && isInitialized) { | ||
authService === null || authService === void 0 ? void 0 : authService.authorize({ prompt: 'none' }, { isRetrying: true }); | ||
@@ -100,2 +101,3 @@ } | ||
authService, | ||
isInitialized, | ||
]); | ||
@@ -102,0 +104,0 @@ return isSessionExpired; |
@@ -10,3 +10,3 @@ import { create } from 'zustand'; | ||
isLoggedIn: false, | ||
isInitialized: !client, | ||
isInitialized: false, | ||
didRetryLogin: false, | ||
@@ -13,0 +13,0 @@ }; |
{ | ||
"name": "oidc-jwt-client", | ||
"version": "4.0.18-develop.6", | ||
"version": "4.0.18-develop.7", | ||
"description": "Fetch JWTs for API access from oidc-jwt-provider", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
173208
1659