@axinom/mosaic-id-link 0.21.0 → 0.22.0

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": "@axinom/mosaic-id-link",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "description": "Integration utilities from id-service for application frontends",
5
5
  "author": "Axinom",
6
6
  "license": "PROPRIETARY",
@@ -28,8 +28,8 @@
28
28
  "util:load-vars": "env-cmd --silent -f ../../../.env env-cmd --silent -f ../../../.env.dev env-cmd --silent -f .env env-cmd --silent -f .env.dev"
29
29
  },
30
30
  "dependencies": {
31
- "@axinom/mosaic-id-utils": "^0.26.0",
32
- "@axinom/mosaic-ui": "^0.70.0",
31
+ "@axinom/mosaic-id-utils": "^0.27.0",
32
+ "@axinom/mosaic-ui": "^0.71.0",
33
33
  "clsx": "^1.1.0",
34
34
  "formik": "^2.1.4",
35
35
  "graphql": "^15.4.0",
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "9732fd094fafedb5360d10405cc19fa202d42de6"
76
+ "gitHead": "75dcfd9bf92de1ef72a28f073e43a7dfaa7b430b"
77
77
  }
@@ -251,11 +251,30 @@ export const createIdentityServiceClient = (
251
251
  // We want the user to be considered logged out, so we throw emit the TokenChanged here using 'null'.
252
252
  emitTokenChanged(null);
253
253
 
254
- const logoutResult = await invokeIdentityServiceMethod<LogoutResponse>(
254
+ const logoutUrl = concatUrl(
255
+ config.idServiceAuthBaseUrl,
256
+ config.tenantId,
257
+ config.environmentId,
255
258
  'logout',
256
259
  );
260
+ logoutUrl.searchParams.set(
261
+ 'post_logout_redirect_uri',
262
+ window.location.origin,
263
+ );
264
+
265
+ const logoutResult = (await (
266
+ await fetch(logoutUrl.toString(), {
267
+ cache: 'no-cache',
268
+ credentials: 'include',
269
+ redirect: 'follow',
270
+ referrerPolicy: 'origin',
271
+ })
272
+ ).json()) as LogoutResponse;
257
273
 
258
274
  if (logoutResult && logoutResult.code === LogoutResponseCode.SUCCESS) {
275
+ if (logoutResult.idpLogoutUrl) {
276
+ window.location.assign(logoutResult.idpLogoutUrl);
277
+ }
259
278
  return true;
260
279
  } else {
261
280
  return false;