@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/dist/esm/hooks/useKeycloak/useKeycloak.mjs.map +1 -1
- package/dist/esm/provider/keycloakProvider.mjs +7 -4
- package/dist/esm/provider/keycloakProvider.mjs.map +2 -2
- package/dist/jsx/hooks/useKeycloak/useKeycloak.mjs.map +1 -1
- package/dist/jsx/provider/keycloakProvider.mjs +7 -4
- package/dist/jsx/provider/keycloakProvider.mjs.map +2 -2
- package/dist/lib/hooks/useKeycloak/useKeycloak.d.ts +1 -1
- package/dist/lib/hooks/useKeycloak/useKeycloak.js.map +1 -1
- package/dist/lib/provider/keycloakProvider.js +7 -4
- package/dist/lib/provider/keycloakProvider.js.map +2 -2
- package/dist/lib/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/hooks/useKeycloak/useKeycloak.ts +1 -1
- package/src/provider/keycloakProvider.tsx +6 -3
package/package.json
CHANGED
|
@@ -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
|
-
|
|
191
|
-
|
|
191
|
+
if (explicitToken) {
|
|
192
|
+
initOptions.checkLoginIframe = false;
|
|
193
|
+
initOptions.onLoad = undefined;
|
|
194
|
+
}
|
|
192
195
|
}
|
|
193
196
|
return initOptions;
|
|
194
197
|
}, [keycloakInitOptions, token, refreshToken, idToken]);
|