@multiplatform.one/keycloak 0.2.3 → 0.2.4

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.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "keycloak client for multiplatform.one ecosystem",
5
5
  "main": "dist/lib",
6
6
  "module": "dist/esm",
@@ -4,7 +4,7 @@
4
4
  * File Created: 08-11-2022 06:04:59
5
5
  * Author: Clay Risser
6
6
  * -----
7
- * Last Modified: 18-04-2023 02:57:42
7
+ * Last Modified: 18-04-2023 04:08:56
8
8
  * Modified By: Clay Risser
9
9
  * -----
10
10
  * Risser Labs LLC (c) Copyright 2021 - 2022
@@ -69,6 +69,7 @@ export const KeycloakProvider: FC<KeycloakProviderProps> = ({
69
69
  (('refreshToken' in query && (query.refreshToken?.toString() || true)) || authState.refreshToken)) ||
70
70
  false,
71
71
  );
72
+ const explicitToken = 'idToken' in query || 'token' in query || 'refreshToken' in query;
72
73
 
73
74
  useEffect(() => {
74
75
  if (token !== true && refreshToken !== true && idToken !== true) return;
@@ -183,12 +184,14 @@ export const KeycloakProvider: FC<KeycloakProviderProps> = ({
183
184
  ...defaultKeycloakInitOptions,
184
185
  ...keycloakInitOptions,
185
186
  };
186
- if (idToken && typeof idToken === 'string') initOptions.idToken = idToken;
187
187
  if (token && typeof token === 'string') {
188
188
  initOptions.token = token;
189
+ if (idToken && typeof idToken === 'string') initOptions.idToken = idToken;
189
190
  if (refreshToken && typeof refreshToken === 'string') initOptions.refreshToken = refreshToken;
190
- initOptions.checkLoginIframe = false;
191
- initOptions.onLoad = undefined;
191
+ if (explicitToken) {
192
+ initOptions.checkLoginIframe = false;
193
+ initOptions.onLoad = undefined;
194
+ }
192
195
  }
193
196
  return initOptions;
194
197
  }, [keycloakInitOptions, token, refreshToken, idToken]);