oidc-jwt-client
Advanced tools
Comparing version 4.0.18-develop.8 to 4.0.18-develop.9
@@ -5,2 +5,3 @@ 'use strict'; | ||
var React = require('react'); | ||
var reactUse = require('react-use'); | ||
var zustand = require('zustand'); | ||
@@ -53,3 +54,3 @@ var constants = require('./constants.js'); | ||
setIsInitializing(isInitializing); | ||
}, [authService, isLoggedIn, shouldAttemptLogin]); | ||
}, [authService, isLoggedIn, isMounted, shouldAttemptLogin]); | ||
if (isInitializing) { | ||
@@ -64,3 +65,3 @@ return null; | ||
var store$1 = React.useRef(store.createOidcJwtClientStore(client, removeTokenFromUrlFunction)).current; | ||
React.useEffect(function () { | ||
reactUse.useIsomorphicLayoutEffect(function () { | ||
var initialState = { | ||
@@ -75,3 +76,2 @@ userInfo: storage.Storage.get(constants.USER_INFO_TOKEN_STORAGE_KEY), | ||
service === null || service === void 0 ? void 0 : service.setState(initialState); | ||
store$1.setState({ authState: initialState }); | ||
setMounted(true); | ||
@@ -78,0 +78,0 @@ }, [store$1]); |
import { __assign } from './node_modules/tslib/tslib.es6.js'; | ||
import React, { createContext, useContext, useState, useRef, useEffect } from 'react'; | ||
import { useIsomorphicLayoutEffect } from 'react-use'; | ||
import { useStore } from 'zustand'; | ||
@@ -46,3 +47,3 @@ import { USER_INFO_TOKEN_STORAGE_KEY, CSRF_TOKEN_STORAGE_KEY, LOGGED_IN_TOKEN_STORAGE_KEY, RETRY_LOGIN_STORAGE_KEY } from './constants.js'; | ||
setIsInitializing(isInitializing); | ||
}, [authService, isLoggedIn, shouldAttemptLogin]); | ||
}, [authService, isLoggedIn, isMounted, shouldAttemptLogin]); | ||
if (isInitializing) { | ||
@@ -57,3 +58,3 @@ return null; | ||
var store = useRef(createOidcJwtClientStore(client, removeTokenFromUrlFunction)).current; | ||
useEffect(function () { | ||
useIsomorphicLayoutEffect(function () { | ||
var initialState = { | ||
@@ -68,3 +69,2 @@ userInfo: Storage.get(USER_INFO_TOKEN_STORAGE_KEY), | ||
service === null || service === void 0 ? void 0 : service.setState(initialState); | ||
store.setState({ authState: initialState }); | ||
setMounted(true); | ||
@@ -71,0 +71,0 @@ }, [store]); |
{ | ||
"name": "oidc-jwt-client", | ||
"version": "4.0.18-develop.8", | ||
"version": "4.0.18-develop.9", | ||
"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
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
174163