Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

@react-keycloak/web executes onTokens callback function twice #181

Open
buglessir opened this issue Feb 17, 2022 · 1 comment
Open

@react-keycloak/web executes onTokens callback function twice #181

buglessir opened this issue Feb 17, 2022 · 1 comment

Comments

@buglessir
Copy link

Describe the bug
We are using @react-keycloak/web provider in our app and I realized <ReactKeycloakProvider /> component executes callback function which I pass in onTokens prop twice.

To Reproduce
For example:

<ReactKeycloakProvider
      authClient={keycloak}
      LoadingComponent={<KeycloakLoading size="middle" />}
      initOptions={{
        onLoad: 'login-required',
      }}
      autoRefreshToken={true}
      onTokens={console.log}
      onEvent={console.log}
    >
      {children}
    </ReactKeycloakProvider>

Expected behavior
I expected it execute onTokens once and doesn't send 2 requests to server.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version: 98
@buglessir buglessir changed the title @react-keycloak/web executes twice onTokens callback function @react-keycloak/web executes onTokens callback function twice Feb 17, 2022
@j1cs
Copy link

j1cs commented Jul 4, 2022

onTokens trigger on every keycloak event.
You can check this logging onEvent and see how onTokens always change on every event.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants