@multiplatform.one/keycloak 0.3.23 → 0.3.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/keycloak",
3
- "version": "0.3.23",
3
+ "version": "0.3.25",
4
4
  "description": "keycloak client for multiplatform.one ecosystem",
5
5
  "main": "dist/lib",
6
6
  "module": "dist/esm",
@@ -50,7 +50,7 @@ export function Authenticated({ children, disabled, loginRoute, loggedOutCompone
50
50
  authState.setRefreshToken('');
51
51
  authState.setToken('');
52
52
  }
53
- if (typeof window !== 'undefined' && !tokensFromQuery && !tokensFromState) login();
53
+ if (typeof window !== 'undefined' && !tokensFromQuery && !tokensFromState && window.self === window.top) login();
54
54
  }, [authenticated]);
55
55
 
56
56
  if (disabled || authenticated) return <>{children}</>;
@@ -33,7 +33,6 @@ import { ReactKeycloakProvider } from '@bitspur/react-keycloak-web';
33
33
  import { SSRKeycloakProvider, SSRCookies } from '@bitspur/react-keycloak-ssr';
34
34
  import { useAuthConfig } from '../hooks/useAuthConfig';
35
35
  import { useAuthState } from '../state';
36
- import { useTokensFromQuery } from '../hooks';
37
36
  import { useRouter } from 'next/router';
38
37
  import { validToken } from '../util';
39
38
 
@@ -82,7 +81,6 @@ export function KeycloakProvider({
82
81
  refreshToken,
83
82
  ),
84
83
  );
85
- const tokensFromQuery = useTokensFromQuery();
86
84
 
87
85
  useEffect(() => {
88
86
  if (token !== true && refreshToken !== true && idToken !== true) return;
@@ -225,7 +223,7 @@ export function KeycloakProvider({
225
223
  if (idToken && typeof idToken === 'string') initOptions.idToken = idToken;
226
224
  if (refreshToken && typeof refreshToken === 'string') initOptions.refreshToken = refreshToken;
227
225
  }
228
- if (tokensFromQuery) {
226
+ if (window.self !== window.top) {
229
227
  initOptions.checkLoginIframe = false;
230
228
  initOptions.flow = 'implicit';
231
229
  initOptions.onLoad = undefined;