diff --git a/package.json b/package.json index 9cd9137..aaf111b 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "git", "url": "https://github.com/PropelAuth/react" }, - "version": "2.0.31", + "version": "2.0.32", "license": "MIT", "keywords": [ "auth", @@ -13,7 +13,7 @@ "user" ], "dependencies": { - "@propelauth/javascript": "^2.0.22", + "@propelauth/javascript": "^2.0.23", "hoist-non-react-statics": "^3.3.2", "utility-types": "^3.10.0" }, diff --git a/src/index.test.js b/src/index.test.js index 579fa58..2b56a9e 100644 --- a/src/index.test.js +++ b/src/index.test.js @@ -603,7 +603,7 @@ function createMockClient() { const AUTH_URL = "authUrl" function expectCreateClientWasCalledCorrectly() { - expect(createClient).toHaveBeenCalledWith({ authUrl: AUTH_URL, enableBackgroundTokenRefresh: true }) + expect(createClient).toHaveBeenCalledWith({ authUrl: AUTH_URL, enableBackgroundTokenRefresh: true, skipInitialFetch: true }) } function createOrg() { diff --git a/src/useClientRef.tsx b/src/useClientRef.tsx index 50ea701..aba5652 100644 --- a/src/useClientRef.tsx +++ b/src/useClientRef.tsx @@ -18,7 +18,7 @@ export const useClientRef = (props: UseClientRefProps) => { // Use a ref to store the client so that it doesn't get recreated on every render const clientRef = useRef(null) if (clientRef.current === null) { - const client = createClient({ authUrl, enableBackgroundTokenRefresh: true, minSecondsBeforeRefresh }) + const client = createClient({ authUrl, enableBackgroundTokenRefresh: true, minSecondsBeforeRefresh, skipInitialFetch: true }) client.addAccessTokenChangeObserver(() => setAccessTokenChangeCounter((x) => x + 1)) clientRef.current = { authUrl, client } } @@ -32,7 +32,7 @@ export const useClientRef = (props: UseClientRefProps) => { } else { clientRef.current.client.destroy() - const newClient = createClient({ authUrl, enableBackgroundTokenRefresh: true, minSecondsBeforeRefresh }) + const newClient = createClient({ authUrl, enableBackgroundTokenRefresh: true, minSecondsBeforeRefresh, skipInitialFetch: true }) newClient.addAccessTokenChangeObserver(() => setAccessTokenChangeCounter((x) => x + 1)) clientRef.current = { authUrl, client: newClient } }