@multiplatform.one/keycloak 0.3.4 → 0.3.6
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/provider/keycloakProvider.mjs +6 -5
- package/dist/esm/provider/keycloakProvider.mjs.map +2 -2
- package/dist/jsx/provider/keycloakProvider.mjs +6 -5
- package/dist/jsx/provider/keycloakProvider.mjs.map +2 -2
- package/dist/lib/provider/keycloakProvider.js +6 -5
- package/dist/lib/provider/keycloakProvider.js.map +2 -2
- package/dist/lib/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/provider/keycloakProvider.tsx +6 -5
package/package.json
CHANGED
|
@@ -102,7 +102,7 @@ export function KeycloakProvider({
|
|
|
102
102
|
data = JSON.parse(data);
|
|
103
103
|
} catch (err) {}
|
|
104
104
|
}
|
|
105
|
-
if (debug) logger.debug('received message', data);
|
|
105
|
+
if (debug) logger.debug('received message', JSON.stringify(data));
|
|
106
106
|
const message: MessageSchema = data;
|
|
107
107
|
if (!message.type) return;
|
|
108
108
|
if (message.type.toUpperCase() === 'REFRESH_TOKEN' && message.payload) {
|
|
@@ -131,7 +131,7 @@ export function KeycloakProvider({
|
|
|
131
131
|
data = JSON.parse(data);
|
|
132
132
|
} catch (err) {}
|
|
133
133
|
}
|
|
134
|
-
if (debug) logger.debug('received message', data);
|
|
134
|
+
if (debug) logger.debug('received message', JSON.stringify(data));
|
|
135
135
|
const message: MessageSchema = data;
|
|
136
136
|
if (!message.type) return;
|
|
137
137
|
if (message.type.toUpperCase() === 'TOKEN' && message.payload) {
|
|
@@ -160,7 +160,7 @@ export function KeycloakProvider({
|
|
|
160
160
|
data = JSON.parse(data);
|
|
161
161
|
} catch (err) {}
|
|
162
162
|
}
|
|
163
|
-
if (debug) logger.debug('received message', data);
|
|
163
|
+
if (debug) logger.debug('received message', JSON.stringify(data));
|
|
164
164
|
const message: MessageSchema = data;
|
|
165
165
|
if (!message.type) return;
|
|
166
166
|
if (message.type.toUpperCase() === 'ID_TOKEN' && message.payload) {
|
|
@@ -198,7 +198,7 @@ export function KeycloakProvider({
|
|
|
198
198
|
realm: keycloakConfig.realm,
|
|
199
199
|
clientId: keycloakConfig.clientId,
|
|
200
200
|
}),
|
|
201
|
-
[],
|
|
201
|
+
[keycloakInitOptions, token, refreshToken, idToken],
|
|
202
202
|
);
|
|
203
203
|
|
|
204
204
|
const initOptions = useMemo(() => {
|
|
@@ -213,6 +213,7 @@ export function KeycloakProvider({
|
|
|
213
213
|
if (refreshToken && typeof refreshToken === 'string') initOptions.refreshToken = refreshToken;
|
|
214
214
|
if (isPassedInToken) {
|
|
215
215
|
initOptions.checkLoginIframe = false;
|
|
216
|
+
initOptions.flow = 'implicit';
|
|
216
217
|
initOptions.onLoad = undefined;
|
|
217
218
|
}
|
|
218
219
|
}
|
|
@@ -220,7 +221,7 @@ export function KeycloakProvider({
|
|
|
220
221
|
}, [keycloakInitOptions, token, refreshToken, idToken]);
|
|
221
222
|
|
|
222
223
|
if (token === true || idToken === true || refreshToken === true) return <LoadingComponent />;
|
|
223
|
-
if (cookies && ssr) {
|
|
224
|
+
if (!isPassedInToken && cookies && ssr) {
|
|
224
225
|
return (
|
|
225
226
|
// @ts-ignore
|
|
226
227
|
<SSRKeycloakProvider
|