Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oidc-jwt-client

Package Overview
Dependencies
Maintainers
4
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oidc-jwt-client - npm Package Compare versions

Comparing version 4.0.18-develop.6 to 4.0.18-develop.7

8

dist/cjs/hooks.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc