@linzjs/lui 17.5.11 → 17.5.12

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [17.5.12](https://github.com/linz/lui/compare/v17.5.11...v17.5.12) (2022-07-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **LogoutLink:** SEARCH-3373 Add a callback to LogoutLink, so app can do something before logout. ([#709](https://github.com/linz/lui/issues/709)) ([67c7030](https://github.com/linz/lui/commit/67c703059ad8903b090bc36a487ed034938d23f2))
7
+
1
8
  ## [17.5.11](https://github.com/linz/lui/compare/v17.5.10...v17.5.11) (2022-07-25)
2
9
 
3
10
 
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export interface Props {
3
3
  redirectPath: () => string;
4
+ callBackBeforeLogout?: () => Promise<void>;
4
5
  }
5
6
  export declare const LOLLogoutLink: (props: Props) => JSX.Element | null;
package/dist/index.js CHANGED
@@ -56601,8 +56601,14 @@ var LOLLogoutLink = function (props) {
56601
56601
  var res;
56602
56602
  return __generator(this, function (_a) {
56603
56603
  switch (_a.label) {
56604
- case 0: return [4 /*yield*/, fetch('/auth/api/logout')];
56604
+ case 0:
56605
+ if (!props.callBackBeforeLogout) return [3 /*break*/, 2];
56606
+ return [4 /*yield*/, props.callBackBeforeLogout()];
56605
56607
  case 1:
56608
+ _a.sent();
56609
+ _a.label = 2;
56610
+ case 2: return [4 /*yield*/, fetch('/auth/api/logout')];
56611
+ case 3:
56606
56612
  res = _a.sent();
56607
56613
  if (res.status === 200) {
56608
56614
  window.location.assign("/auth/login?redirectPath=" + redirectPathString);