Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"type": "git",
"url": "https://github.com/PropelAuth/react"
},
"version": "2.0.31",
"version": "2.0.32",
"license": "MIT",
"keywords": [
"auth",
"react",
"user"
],
"dependencies": {
"@propelauth/javascript": "^2.0.22",
"@propelauth/javascript": "^2.0.23",
"hoist-non-react-statics": "^3.3.2",
"utility-types": "^3.10.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions src/useClientRef.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<ClientRef | null>(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 }
}
Expand All @@ -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 }
}
Expand Down