@commercetools-frontend/application-shell 21.23.9 → 21.24.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.
Files changed (208) hide show
  1. package/dist/application-entry-point-2a64a561.cjs.dev.js +116 -0
  2. package/dist/application-entry-point-3bb7f8bd.cjs.prod.js +99 -0
  3. package/dist/application-entry-point-58dd4b7f.esm.js +101 -0
  4. package/dist/{box-dd9e7e68.esm.js → box-4395623b.esm.js} +1 -3
  5. package/dist/{box-fdb2ccb6.cjs.dev.js → box-6b5be9a9.cjs.dev.js} +1 -3
  6. package/dist/{box-d849ea03.cjs.prod.js → box-8850277f.cjs.prod.js} +1 -3
  7. package/dist/{cart-ad0aba9b.cjs.prod.js → cart-0698b97d.cjs.prod.js} +1 -3
  8. package/dist/{cart-b92f3a8e.cjs.dev.js → cart-41f0b7bc.cjs.dev.js} +1 -3
  9. package/dist/{cart-167fea3b.esm.js → cart-a49faf67.esm.js} +1 -3
  10. package/dist/commercetools-frontend-application-shell.cjs.dev.js +49 -68
  11. package/dist/commercetools-frontend-application-shell.cjs.prod.js +49 -68
  12. package/dist/commercetools-frontend-application-shell.esm.js +39 -58
  13. package/dist/configure-apollo-1f39e35a.cjs.dev.js +930 -0
  14. package/dist/configure-apollo-5f1fd942.esm.js +873 -0
  15. package/dist/configure-apollo-d11de242.cjs.prod.js +922 -0
  16. package/dist/{connected-square-4743b7de.esm.js → connected-square-3cac6bd7.esm.js} +1 -3
  17. package/dist/connected-square-47233754.cjs.dev.js +32 -0
  18. package/dist/connected-square-b2e25621.cjs.prod.js +32 -0
  19. package/dist/{constants-69249abd.esm.js → constants-7f04db3f.esm.js} +9 -9
  20. package/dist/{constants-88fb9ef8.cjs.prod.js → constants-e6409334.cjs.prod.js} +8 -8
  21. package/dist/{constants-c2d56f3d.cjs.dev.js → constants-e6f058e5.cjs.dev.js} +8 -8
  22. package/dist/declarations/src/apollo-links/utils.d.ts +2 -2
  23. package/dist/declarations/src/components/application-entry-point/application-entry-point.d.ts +4 -4
  24. package/dist/declarations/src/components/application-shell/application-shell.d.ts +7 -15
  25. package/dist/declarations/src/components/application-shell-authenticated/application-shell-authenticated.d.ts +21 -0
  26. package/dist/declarations/src/components/application-shell-provider/application-shell-provider.d.ts +6 -7
  27. package/dist/declarations/src/components/application-shell-provider/use-coerced-environment-values.d.ts +1 -23
  28. package/dist/declarations/src/components/authenticated/authenticated.d.ts +2 -2
  29. package/dist/declarations/src/components/authenticated/oidc-callback.async.d.ts +6 -0
  30. package/dist/declarations/src/components/authenticated/oidc-callback.d.ts +2 -2
  31. package/dist/declarations/src/components/configure-intl-provider/configure-intl-provider.d.ts +1 -1
  32. package/dist/declarations/src/components/error-apologizer/index.d.ts +6 -1
  33. package/dist/declarations/src/components/fetch-project/fetch-project.d.ts +4 -4
  34. package/dist/declarations/src/components/fetch-user/fetch-user.d.ts +3 -3
  35. package/dist/declarations/src/components/inject-reducers/inject-reducers.d.ts +1 -1
  36. package/dist/declarations/src/components/navbar/index.d.ts +100 -1
  37. package/dist/declarations/src/components/navbar/loading-navbar.d.ts +5 -0
  38. package/dist/declarations/src/components/navbar/menu-items.d.ts +99 -0
  39. package/dist/declarations/src/components/navbar/navbar.d.ts +6 -15
  40. package/dist/declarations/src/components/project-container/index.d.ts +78 -1
  41. package/dist/declarations/src/components/project-container/project-container.d.ts +6 -8
  42. package/dist/declarations/src/components/quick-access/butler-command/butler-command.d.ts +1 -1
  43. package/dist/declarations/src/components/quick-access/index.d.ts +2 -2
  44. package/dist/declarations/src/components/quick-access/types.d.ts +1 -1
  45. package/dist/declarations/src/components/redirect-to-login/index.d.ts +6 -0
  46. package/dist/declarations/src/components/redirect-to-logout/index.d.ts +5 -0
  47. package/dist/declarations/src/components/redirect-to-project-create/index.d.ts +6 -1
  48. package/dist/declarations/src/components/requests-in-flight-loader/index.d.ts +6 -1
  49. package/dist/declarations/src/components/route-catch-all/index.d.ts +3 -1
  50. package/dist/declarations/src/components/setup-flop-flip-provider/setup-flop-flip-provider.d.ts +3 -3
  51. package/dist/declarations/src/components/suspended-route/suspended-route.d.ts +1 -1
  52. package/dist/declarations/src/components/user-settings-menu/index.d.ts +12 -1
  53. package/dist/declarations/src/components/version-tracker/index.d.ts +6 -1
  54. package/dist/declarations/src/hooks/apollo-hooks/apollo-hooks.d.ts +1 -1
  55. package/dist/declarations/src/test-utils/test-utils.d.ts +2 -2
  56. package/dist/declarations/src/types/generated/mc.d.ts +3 -3
  57. package/dist/declarations/src/utils/get-mc-origin/get-mc-origin.d.ts +2 -0
  58. package/dist/declarations/src/utils/get-mc-origin/index.d.ts +1 -0
  59. package/dist/error-apologizer-c336db61.cjs.dev.js +56 -0
  60. package/dist/error-apologizer-c55ec6f7.cjs.prod.js +56 -0
  61. package/dist/error-apologizer-f8772b68.esm.js +42 -0
  62. package/dist/gear-2890f7fb.cjs.prod.js +32 -0
  63. package/dist/{gear-8418cd46.esm.js → gear-300dd24c.esm.js} +1 -3
  64. package/dist/gear-e8014c5a.cjs.dev.js +32 -0
  65. package/dist/get-mc-origin-314b77a2.cjs.dev.js +57 -0
  66. package/dist/get-mc-origin-5df60933.esm.js +50 -0
  67. package/dist/get-mc-origin-7968e04f.cjs.prod.js +57 -0
  68. package/dist/heart-000a023d.cjs.prod.js +32 -0
  69. package/dist/{heart-48c28091.esm.js → heart-dded66b4.esm.js} +1 -3
  70. package/dist/heart-f21b7d39.cjs.dev.js +32 -0
  71. package/dist/index-5048bf47.cjs.dev.js +3054 -0
  72. package/dist/index-b002eca6.esm.js +2970 -0
  73. package/dist/index-e0ab178f.cjs.prod.js +2870 -0
  74. package/dist/{list-with-search-c154a56e.esm.js → list-with-search-a3302710.esm.js} +1 -3
  75. package/dist/list-with-search-a5b72b33.cjs.prod.js +32 -0
  76. package/dist/list-with-search-ee796e9e.cjs.dev.js +32 -0
  77. package/dist/navbar-40650ed4.cjs.dev.js +670 -0
  78. package/dist/navbar-997b4a36.cjs.prod.js +649 -0
  79. package/dist/navbar-f4b482d0.esm.js +650 -0
  80. package/dist/oidc-0638d0c8.cjs.dev.js +67 -0
  81. package/dist/oidc-10fa96f0.esm.js +59 -0
  82. package/dist/oidc-540a091a.cjs.prod.js +67 -0
  83. package/dist/oidc-callback-1047744c.cjs.dev.js +254 -0
  84. package/dist/oidc-callback-b32405ab.cjs.prod.js +251 -0
  85. package/dist/oidc-callback-e2ca889b.esm.js +240 -0
  86. package/dist/paperclip-23d1e69c.cjs.prod.js +32 -0
  87. package/dist/{paperclip-18785dda.esm.js → paperclip-a61112e8.esm.js} +1 -3
  88. package/dist/paperclip-d653c134.cjs.dev.js +32 -0
  89. package/dist/plugin-0ee6aee4.cjs.dev.js +32 -0
  90. package/dist/{plugin-53c047bb.esm.js → plugin-3d353a5b.esm.js} +1 -3
  91. package/dist/plugin-7e57f237.cjs.prod.js +32 -0
  92. package/dist/project-container-05a4e261.esm.js +368 -0
  93. package/dist/project-container-1cf9964e.cjs.dev.js +387 -0
  94. package/dist/project-container-65fccf05.cjs.prod.js +369 -0
  95. package/dist/{project-expired-b84abd3a.esm.js → project-expired-0d18d9ef.esm.js} +47 -68
  96. package/dist/{project-expired-0c72c956.cjs.dev.js → project-expired-b8480245.cjs.dev.js} +47 -68
  97. package/dist/{project-expired-0f9d4a23.cjs.prod.js → project-expired-e757e66c.cjs.prod.js} +47 -68
  98. package/dist/{project-not-found-14dc05c1.cjs.dev.js → project-not-found-1b4527b4.cjs.dev.js} +42 -61
  99. package/dist/{project-not-found-8002ba67.esm.js → project-not-found-4bc57bab.esm.js} +42 -61
  100. package/dist/{project-not-found-419be633.cjs.prod.js → project-not-found-6808c525.cjs.prod.js} +42 -61
  101. package/dist/{project-not-initialized-cd8e8160.cjs.dev.js → project-not-initialized-3351f8b7.cjs.prod.js} +47 -68
  102. package/dist/{project-not-initialized-3a477d13.esm.js → project-not-initialized-5eef98f9.esm.js} +47 -68
  103. package/dist/{project-not-initialized-10cbf15a.cjs.prod.js → project-not-initialized-d13a6be3.cjs.dev.js} +47 -68
  104. package/dist/{project-suspended-243ddda8.cjs.dev.js → project-suspended-4ed362c3.cjs.prod.js} +44 -63
  105. package/dist/{project-suspended-50c6dd60.esm.js → project-suspended-7843e028.esm.js} +44 -63
  106. package/dist/{project-suspended-dffcecd1.cjs.prod.js → project-suspended-c5b996b0.cjs.dev.js} +44 -63
  107. package/dist/quick-access-3acb2b6a.cjs.dev.js +1937 -0
  108. package/dist/{quick-access-fc734889.cjs.prod.js → quick-access-5c5074c7.cjs.prod.js} +573 -957
  109. package/dist/quick-access-fdb9024d.esm.js +1907 -0
  110. package/dist/redirect-to-login-5ac864e2.cjs.prod.js +149 -0
  111. package/dist/redirect-to-login-80d7ff2f.cjs.dev.js +149 -0
  112. package/dist/redirect-to-login-824d52b9.esm.js +147 -0
  113. package/dist/redirect-to-logout-6df9b79c.esm.js +138 -0
  114. package/dist/redirect-to-logout-7d5c817e.cjs.prod.js +151 -0
  115. package/dist/redirect-to-logout-a78f7193.cjs.dev.js +151 -0
  116. package/dist/redirect-to-project-create-048efa71.cjs.prod.js +61 -0
  117. package/dist/redirect-to-project-create-052f293e.esm.js +52 -0
  118. package/dist/redirect-to-project-create-f0e7b35e.cjs.dev.js +61 -0
  119. package/dist/{gear-28ff4f04.cjs.dev.js → redirector-0d98f9df.cjs.dev.js} +44 -5
  120. package/dist/redirector-47a6be71.esm.js +58 -0
  121. package/dist/{gear-6f8c30e3.cjs.prod.js → redirector-77ce2f5c.cjs.prod.js} +44 -5
  122. package/dist/requests-in-flight-loader-3bc8dd8a.cjs.dev.js +144 -0
  123. package/dist/requests-in-flight-loader-c3e4205b.cjs.prod.js +144 -0
  124. package/dist/requests-in-flight-loader-fe4c165f.esm.js +129 -0
  125. package/dist/rocket-3e3f0a98.cjs.prod.js +32 -0
  126. package/dist/{rocket-ba116b5e.esm.js → rocket-4b088727.esm.js} +1 -3
  127. package/dist/rocket-95b6858d.cjs.dev.js +32 -0
  128. package/dist/route-catch-all-01cf0095.esm.js +41 -0
  129. package/dist/route-catch-all-3b490df1.cjs.prod.js +43 -0
  130. package/dist/route-catch-all-9ac99936.cjs.dev.js +43 -0
  131. package/dist/{service-page-project-switcher-e3195b51.cjs.prod.js → service-page-project-switcher-6865e150.cjs.prod.js} +5 -7
  132. package/dist/{service-page-project-switcher-fa253254.cjs.dev.js → service-page-project-switcher-e8a7e5d7.cjs.dev.js} +6 -8
  133. package/dist/{service-page-project-switcher-6c39bf55.esm.js → service-page-project-switcher-fcc8d186.esm.js} +6 -8
  134. package/dist/{speedometer-c1b94505.esm.js → speedometer-08a11d5a.esm.js} +1 -3
  135. package/dist/speedometer-2881cef6.cjs.prod.js +32 -0
  136. package/dist/speedometer-54f872f2.cjs.dev.js +32 -0
  137. package/dist/{star-da9123e0.esm.js → star-15244db1.esm.js} +1 -3
  138. package/dist/star-52bf7a64.cjs.dev.js +32 -0
  139. package/dist/star-f8502efb.cjs.prod.js +32 -0
  140. package/dist/tag-multi-1d1553b6.cjs.dev.js +32 -0
  141. package/dist/{tag-multi-c650b738.esm.js → tag-multi-3be995ac.esm.js} +1 -3
  142. package/dist/tag-multi-f9acb1c2.cjs.prod.js +32 -0
  143. package/dist/tree-structure-4650688d.cjs.dev.js +32 -0
  144. package/dist/{tree-structure-6af6fc3a.esm.js → tree-structure-c8753526.esm.js} +1 -3
  145. package/dist/tree-structure-f24ee3f6.cjs.prod.js +32 -0
  146. package/dist/use-applications-menu-1925f36a.esm.js +172 -0
  147. package/dist/use-applications-menu-7e438b2a.cjs.prod.js +188 -0
  148. package/dist/use-applications-menu-f6f68bf7.cjs.dev.js +188 -0
  149. package/dist/use-is-served-by-proxy-2b4916e5.cjs.dev.js +42 -0
  150. package/dist/use-is-served-by-proxy-499bfa16.esm.js +39 -0
  151. package/dist/use-is-served-by-proxy-51e76976.cjs.prod.js +42 -0
  152. package/dist/{user-filled-41729d77.esm.js → user-filled-2dc4e79e.esm.js} +1 -3
  153. package/dist/user-filled-2e6cb25e.cjs.dev.js +32 -0
  154. package/dist/user-filled-815b49a0.cjs.prod.js +32 -0
  155. package/dist/user-settings-menu-96de467a.cjs.prod.js +496 -0
  156. package/dist/user-settings-menu-d831de89.esm.js +497 -0
  157. package/dist/user-settings-menu-e38c73ac.cjs.dev.js +523 -0
  158. package/dist/version-tracker-51646901.cjs.prod.js +107 -0
  159. package/dist/version-tracker-57ea3aa1.cjs.dev.js +107 -0
  160. package/dist/version-tracker-afb522da.esm.js +101 -0
  161. package/dist/world-973090a5.cjs.dev.js +32 -0
  162. package/dist/{world-d91df1ee.esm.js → world-c5ea311a.esm.js} +1 -3
  163. package/dist/world-e1f9dbf8.cjs.prod.js +32 -0
  164. package/package.json +39 -39
  165. package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.dev.js +2 -3
  166. package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.prod.js +2 -3
  167. package/ssr/dist/commercetools-frontend-application-shell-ssr.esm.js +2 -3
  168. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +182 -215
  169. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +182 -215
  170. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +173 -206
  171. package/dist/application-entry-point-180dbaa1.cjs.prod.js +0 -1225
  172. package/dist/application-entry-point-55376ed2.esm.js +0 -1180
  173. package/dist/application-entry-point-63abd0c1.cjs.dev.js +0 -1250
  174. package/dist/connected-square-abf36852.cjs.prod.js +0 -34
  175. package/dist/connected-square-ac52014f.cjs.dev.js +0 -34
  176. package/dist/declarations/src/components/application-shell/helpers.d.ts +0 -1
  177. package/dist/heart-33cd94c6.cjs.prod.js +0 -34
  178. package/dist/heart-fb31cf30.cjs.dev.js +0 -34
  179. package/dist/index-27953285.esm.js +0 -4809
  180. package/dist/index-4508ebb0.cjs.prod.js +0 -4643
  181. package/dist/index-d693db30.cjs.dev.js +0 -4888
  182. package/dist/list-with-search-34cd926c.cjs.dev.js +0 -34
  183. package/dist/list-with-search-a0b22169.cjs.prod.js +0 -34
  184. package/dist/oidc-1c91f5ee.cjs.prod.js +0 -67
  185. package/dist/oidc-5b2e4f8f.cjs.dev.js +0 -67
  186. package/dist/oidc-77749f1b.esm.js +0 -59
  187. package/dist/paperclip-2cd45b86.cjs.dev.js +0 -34
  188. package/dist/paperclip-b1b806ab.cjs.prod.js +0 -34
  189. package/dist/plugin-7cb7827e.cjs.dev.js +0 -34
  190. package/dist/plugin-e97ae3e6.cjs.prod.js +0 -34
  191. package/dist/quick-access-1b241811.cjs.dev.js +0 -2321
  192. package/dist/quick-access-6159845a.esm.js +0 -2290
  193. package/dist/rocket-37c1aa11.cjs.dev.js +0 -34
  194. package/dist/rocket-b2dbda7f.cjs.prod.js +0 -34
  195. package/dist/speedometer-13b393fb.cjs.dev.js +0 -34
  196. package/dist/speedometer-1e69fd13.cjs.prod.js +0 -34
  197. package/dist/star-ab4be629.cjs.prod.js +0 -34
  198. package/dist/star-e165111e.cjs.dev.js +0 -34
  199. package/dist/tag-multi-5f498a7d.cjs.dev.js +0 -34
  200. package/dist/tag-multi-fb817131.cjs.prod.js +0 -34
  201. package/dist/tree-structure-779fcc36.cjs.prod.js +0 -34
  202. package/dist/tree-structure-ed6cdff8.cjs.dev.js +0 -34
  203. package/dist/user-filled-384a2eaf.cjs.prod.js +0 -34
  204. package/dist/user-filled-53d2eae0.cjs.dev.js +0 -34
  205. package/dist/world-12528632.cjs.prod.js +0 -34
  206. package/dist/world-6471d9f6.cjs.dev.js +0 -34
  207. /package/dist/declarations/src/components/{application-shell → redirect-to-login}/redirect-to-login.d.ts +0 -0
  208. /package/dist/declarations/src/components/{application-shell → redirect-to-logout}/redirect-to-logout.d.ts +0 -0
@@ -0,0 +1,149 @@
1
+ 'use strict';
2
+
3
+ var reactRouterDom = require('react-router-dom');
4
+ var uuid = require('uuid');
5
+ var constants = require('@commercetools-frontend/constants');
6
+ var urlUtils = require('@commercetools-frontend/url-utils');
7
+ var constants$1 = require('./constants-e6409334.cjs.prod.js');
8
+ var useIsServedByProxy = require('./use-is-served-by-proxy-51e76976.cjs.prod.js');
9
+ var getMcOrigin = require('./get-mc-origin-7968e04f.cjs.prod.js');
10
+ var oidc = require('./oidc-540a091a.cjs.prod.js');
11
+ var configureApollo = require('./configure-apollo-d11de242.cjs.prod.js');
12
+ var redirector = require('./redirector-77ce2f5c.cjs.prod.js');
13
+ var jsxRuntime = require('@emotion/react/jsx-runtime');
14
+ require('@commercetools-frontend/application-shell-connectors');
15
+ require('@babel/runtime-corejs3/helpers/slicedToArray');
16
+ require('@babel/runtime-corejs3/core-js-stable/url');
17
+ require('@babel/runtime-corejs3/core-js-stable/instance/reverse');
18
+ require('@babel/runtime-corejs3/core-js-stable/instance/concat');
19
+ require('@babel/runtime-corejs3/core-js-stable/instance/map');
20
+ require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
21
+ require('@babel/runtime-corejs3/core-js-stable/object/keys');
22
+ require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
23
+ require('@babel/runtime-corejs3/core-js-stable/instance/filter');
24
+ require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
25
+ require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
26
+ require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
27
+ require('@babel/runtime-corejs3/core-js-stable/object/define-property');
28
+ require('@babel/runtime-corejs3/helpers/defineProperty');
29
+ require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
30
+ require('@babel/runtime-corejs3/core-js-stable/object/entries');
31
+ require('@babel/runtime-corejs3/core-js-stable/reflect/has');
32
+ require('@reduxjs/toolkit');
33
+ require('lodash/mapValues');
34
+ require('omit-empty-es');
35
+ require('redux-thunk');
36
+ require('@commercetools-frontend/notifications');
37
+ require('@commercetools-frontend/sdk');
38
+ require('react');
39
+ require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
40
+ require('@babel/runtime-corejs3/core-js-stable/instance/slice');
41
+ require('@babel/runtime-corejs3/core-js-stable/instance/includes');
42
+ require('@commercetools-frontend/sentry');
43
+ require('@commercetools-frontend/react-notifications');
44
+ require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
45
+ require('redux-logger');
46
+ require('@babel/runtime-corejs3/core-js-stable/instance/find');
47
+ require('@apollo/client');
48
+ require('apollo-link-logger');
49
+ require('@apollo/client/link/error');
50
+ require('@commercetools-frontend/browser-history');
51
+ require('@babel/runtime-corejs3/core-js-stable/array/is-array');
52
+ require('@babel/runtime-corejs3/core-js-stable/instance/some');
53
+ require('@babel/runtime-corejs3/core-js-stable/object/values');
54
+ require('@commercetools/http-user-agent');
55
+ require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
56
+ require('@babel/runtime-corejs3/helpers/createClass');
57
+ require('@babel/runtime-corejs3/helpers/classCallCheck');
58
+ require('@babel/runtime-corejs3/helpers/assertThisInitialized');
59
+ require('@babel/runtime-corejs3/helpers/inherits');
60
+ require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
61
+ require('@babel/runtime-corejs3/helpers/getPrototypeOf');
62
+ require('@babel/runtime-corejs3/helpers/wrapNativeSuper');
63
+ require('@babel/runtime-corejs3/core-js-stable/json/stringify');
64
+ require('@apollo/client/link/retry');
65
+ require('prop-types');
66
+ require('qss');
67
+
68
+ const generateAndCacheNonceWithState = state => {
69
+ const nonce = uuid.v4(); // We store additional information within the given `nonce`
70
+ // to then retrieve it later when the IdP redirects back
71
+ // to our application. The URL will contain the `nonce` within
72
+ // the id_token and, once validated, we can retrieve and use
73
+ // the state object.
74
+ // https://auth0.com/docs/protocols/oauth2/oauth-state#how-to-use-the-parameter-to-restore-application-state
75
+
76
+ configureApollo.setSessionState(nonce, state);
77
+ return nonce;
78
+ };
79
+
80
+ const RedirectToLogin = () => {
81
+ var _window$app$__DEVELOP, _window$app$__DEVELOP2;
82
+
83
+ const location = reactRouterDom.useLocation();
84
+ const servedByProxy = useIsServedByProxy.useIsServedByProxy();
85
+
86
+ if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP2 = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP2 !== void 0 && _window$app$__DEVELOP2.authorizeUrl) {
87
+ var _window$app$__DEVELOP3, _window$app$__DEVELOP4, _window$app$__DEVELOP5, _window$app$__DEVELOP6, _window$app$__DEVELOP7, _window$app$__DEVELOP8, _window$app$__DEVELOP9, _window$app$__DEVELOP10;
88
+
89
+ // We pick the project key from local storage. This assumes that the value
90
+ // as been previously set when the application starts up.
91
+ // This is necessary to allow switching projects and triggering a new login.
92
+ const nextProjectKey = configureApollo.getActiveProjectKey(); // According to the OIDC spec, the `state` parameter is recommended to be sent
93
+ // to the authorization server to help mitigating Cross-Site Request Forgery.
94
+ // https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
95
+ // Using `state` or `nonce` is very similar but with subtle differences.
96
+ // Here we follow the approach described by Auth0 on how to use both, where
97
+ // we generate a `nonce`, store it in session storage together with some state,
98
+ // and send it to the authorization server as the `state` parameter.
99
+ // https://auth0.com/docs/protocols/oauth2/redirect-users
100
+ // Additionally, we still send the `nonce` parameter as well.
101
+
102
+ const sessionId = generateAndCacheNonceWithState({
103
+ applicationId: window.app.applicationId,
104
+ // Store query parameters to be used after the callback redirect
105
+ query: {
106
+ redirectTo: nextProjectKey ? "/".concat(nextProjectKey) : '/'
107
+ }
108
+ });
109
+ const requestedScope = oidc.buildOidcScope({
110
+ projectKey: nextProjectKey !== null && nextProjectKey !== void 0 ? nextProjectKey : undefined,
111
+ oAuthScopes: (_window$app$__DEVELOP3 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP3 === void 0 ? void 0 : (_window$app$__DEVELOP4 = _window$app$__DEVELOP3.oidc) === null || _window$app$__DEVELOP4 === void 0 ? void 0 : _window$app$__DEVELOP4.oAuthScopes,
112
+ additionalOAuthScopes: (_window$app$__DEVELOP5 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP5 === void 0 ? void 0 : (_window$app$__DEVELOP6 = _window$app$__DEVELOP5.oidc) === null || _window$app$__DEVELOP6 === void 0 ? void 0 : _window$app$__DEVELOP6.additionalOAuthScopes,
113
+ teamId: (_window$app$__DEVELOP7 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP7 === void 0 ? void 0 : (_window$app$__DEVELOP8 = _window$app$__DEVELOP7.oidc) === null || _window$app$__DEVELOP8 === void 0 ? void 0 : _window$app$__DEVELOP8.teamId
114
+ }); // Store session scopes, to be able to detect if requested scopes changed
115
+ // in the application config and invalidate the session.
116
+ // This is only valid for local development.
117
+
118
+ configureApollo.setSessionScope(requestedScope);
119
+ return jsxRuntime.jsx(redirector.Redirector, {
120
+ to: "",
121
+ origin: (_window$app$__DEVELOP9 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP9 === void 0 ? void 0 : (_window$app$__DEVELOP10 = _window$app$__DEVELOP9.oidc) === null || _window$app$__DEVELOP10 === void 0 ? void 0 : _window$app$__DEVELOP10.authorizeUrl,
122
+ location: location,
123
+ queryParams: {
124
+ reason: constants.LOGOUT_REASONS.UNAUTHORIZED,
125
+ // Query parameters for OIDC-lik workflow.
126
+ client_id: window.app.applicationId,
127
+ response_type: constants$1.OIDC_RESPONSE_TYPES.ID_TOKEN,
128
+ scope: requestedScope,
129
+ state: sessionId,
130
+ nonce: sessionId
131
+ }
132
+ });
133
+ }
134
+
135
+ const mcOrigin = servedByProxy ? getMcOrigin.getMcOrigin(window.app.mcApiUrl) : undefined;
136
+ return jsxRuntime.jsx(redirector.Redirector, {
137
+ to: "login",
138
+ origin: mcOrigin,
139
+ location: location,
140
+ queryParams: {
141
+ reason: constants.LOGOUT_REASONS.UNAUTHORIZED,
142
+ redirectTo: urlUtils.trimLeadingAndTrailingSlashes(urlUtils.joinPaths(window.location.origin, location.pathname))
143
+ }
144
+ });
145
+ };
146
+
147
+ RedirectToLogin.displayName = 'RedirectToLogin';
148
+
149
+ exports["default"] = RedirectToLogin;
@@ -0,0 +1,149 @@
1
+ 'use strict';
2
+
3
+ var reactRouterDom = require('react-router-dom');
4
+ var uuid = require('uuid');
5
+ var constants = require('@commercetools-frontend/constants');
6
+ var urlUtils = require('@commercetools-frontend/url-utils');
7
+ var constants$1 = require('./constants-e6f058e5.cjs.dev.js');
8
+ var useIsServedByProxy = require('./use-is-served-by-proxy-2b4916e5.cjs.dev.js');
9
+ var getMcOrigin = require('./get-mc-origin-314b77a2.cjs.dev.js');
10
+ var oidc = require('./oidc-0638d0c8.cjs.dev.js');
11
+ var configureApollo = require('./configure-apollo-1f39e35a.cjs.dev.js');
12
+ var redirector = require('./redirector-0d98f9df.cjs.dev.js');
13
+ var jsxRuntime = require('@emotion/react/jsx-runtime');
14
+ require('@commercetools-frontend/application-shell-connectors');
15
+ require('@babel/runtime-corejs3/helpers/slicedToArray');
16
+ require('@babel/runtime-corejs3/core-js-stable/url');
17
+ require('@babel/runtime-corejs3/core-js-stable/instance/reverse');
18
+ require('@babel/runtime-corejs3/core-js-stable/instance/concat');
19
+ require('@babel/runtime-corejs3/core-js-stable/instance/map');
20
+ require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
21
+ require('@babel/runtime-corejs3/core-js-stable/object/keys');
22
+ require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
23
+ require('@babel/runtime-corejs3/core-js-stable/instance/filter');
24
+ require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
25
+ require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
26
+ require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
27
+ require('@babel/runtime-corejs3/core-js-stable/object/define-property');
28
+ require('@babel/runtime-corejs3/helpers/defineProperty');
29
+ require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
30
+ require('@babel/runtime-corejs3/core-js-stable/object/entries');
31
+ require('@babel/runtime-corejs3/core-js-stable/reflect/has');
32
+ require('@reduxjs/toolkit');
33
+ require('lodash/mapValues');
34
+ require('omit-empty-es');
35
+ require('redux-thunk');
36
+ require('@commercetools-frontend/notifications');
37
+ require('@commercetools-frontend/sdk');
38
+ require('react');
39
+ require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
40
+ require('@babel/runtime-corejs3/core-js-stable/instance/slice');
41
+ require('@babel/runtime-corejs3/core-js-stable/instance/includes');
42
+ require('@commercetools-frontend/sentry');
43
+ require('@commercetools-frontend/react-notifications');
44
+ require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
45
+ require('redux-logger');
46
+ require('@babel/runtime-corejs3/core-js-stable/instance/find');
47
+ require('@apollo/client');
48
+ require('apollo-link-logger');
49
+ require('@apollo/client/link/error');
50
+ require('@commercetools-frontend/browser-history');
51
+ require('@babel/runtime-corejs3/core-js-stable/array/is-array');
52
+ require('@babel/runtime-corejs3/core-js-stable/instance/some');
53
+ require('@babel/runtime-corejs3/core-js-stable/object/values');
54
+ require('@commercetools/http-user-agent');
55
+ require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
56
+ require('@babel/runtime-corejs3/helpers/createClass');
57
+ require('@babel/runtime-corejs3/helpers/classCallCheck');
58
+ require('@babel/runtime-corejs3/helpers/assertThisInitialized');
59
+ require('@babel/runtime-corejs3/helpers/inherits');
60
+ require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
61
+ require('@babel/runtime-corejs3/helpers/getPrototypeOf');
62
+ require('@babel/runtime-corejs3/helpers/wrapNativeSuper');
63
+ require('@babel/runtime-corejs3/core-js-stable/json/stringify');
64
+ require('@apollo/client/link/retry');
65
+ require('prop-types');
66
+ require('qss');
67
+
68
+ const generateAndCacheNonceWithState = state => {
69
+ const nonce = uuid.v4(); // We store additional information within the given `nonce`
70
+ // to then retrieve it later when the IdP redirects back
71
+ // to our application. The URL will contain the `nonce` within
72
+ // the id_token and, once validated, we can retrieve and use
73
+ // the state object.
74
+ // https://auth0.com/docs/protocols/oauth2/oauth-state#how-to-use-the-parameter-to-restore-application-state
75
+
76
+ configureApollo.setSessionState(nonce, state);
77
+ return nonce;
78
+ };
79
+
80
+ const RedirectToLogin = () => {
81
+ var _window$app$__DEVELOP, _window$app$__DEVELOP2;
82
+
83
+ const location = reactRouterDom.useLocation();
84
+ const servedByProxy = useIsServedByProxy.useIsServedByProxy();
85
+
86
+ if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP2 = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP2 !== void 0 && _window$app$__DEVELOP2.authorizeUrl) {
87
+ var _window$app$__DEVELOP3, _window$app$__DEVELOP4, _window$app$__DEVELOP5, _window$app$__DEVELOP6, _window$app$__DEVELOP7, _window$app$__DEVELOP8, _window$app$__DEVELOP9, _window$app$__DEVELOP10;
88
+
89
+ // We pick the project key from local storage. This assumes that the value
90
+ // as been previously set when the application starts up.
91
+ // This is necessary to allow switching projects and triggering a new login.
92
+ const nextProjectKey = configureApollo.getActiveProjectKey(); // According to the OIDC spec, the `state` parameter is recommended to be sent
93
+ // to the authorization server to help mitigating Cross-Site Request Forgery.
94
+ // https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
95
+ // Using `state` or `nonce` is very similar but with subtle differences.
96
+ // Here we follow the approach described by Auth0 on how to use both, where
97
+ // we generate a `nonce`, store it in session storage together with some state,
98
+ // and send it to the authorization server as the `state` parameter.
99
+ // https://auth0.com/docs/protocols/oauth2/redirect-users
100
+ // Additionally, we still send the `nonce` parameter as well.
101
+
102
+ const sessionId = generateAndCacheNonceWithState({
103
+ applicationId: window.app.applicationId,
104
+ // Store query parameters to be used after the callback redirect
105
+ query: {
106
+ redirectTo: nextProjectKey ? "/".concat(nextProjectKey) : '/'
107
+ }
108
+ });
109
+ const requestedScope = oidc.buildOidcScope({
110
+ projectKey: nextProjectKey !== null && nextProjectKey !== void 0 ? nextProjectKey : undefined,
111
+ oAuthScopes: (_window$app$__DEVELOP3 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP3 === void 0 ? void 0 : (_window$app$__DEVELOP4 = _window$app$__DEVELOP3.oidc) === null || _window$app$__DEVELOP4 === void 0 ? void 0 : _window$app$__DEVELOP4.oAuthScopes,
112
+ additionalOAuthScopes: (_window$app$__DEVELOP5 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP5 === void 0 ? void 0 : (_window$app$__DEVELOP6 = _window$app$__DEVELOP5.oidc) === null || _window$app$__DEVELOP6 === void 0 ? void 0 : _window$app$__DEVELOP6.additionalOAuthScopes,
113
+ teamId: (_window$app$__DEVELOP7 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP7 === void 0 ? void 0 : (_window$app$__DEVELOP8 = _window$app$__DEVELOP7.oidc) === null || _window$app$__DEVELOP8 === void 0 ? void 0 : _window$app$__DEVELOP8.teamId
114
+ }); // Store session scopes, to be able to detect if requested scopes changed
115
+ // in the application config and invalidate the session.
116
+ // This is only valid for local development.
117
+
118
+ configureApollo.setSessionScope(requestedScope);
119
+ return jsxRuntime.jsx(redirector.Redirector, {
120
+ to: "",
121
+ origin: (_window$app$__DEVELOP9 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP9 === void 0 ? void 0 : (_window$app$__DEVELOP10 = _window$app$__DEVELOP9.oidc) === null || _window$app$__DEVELOP10 === void 0 ? void 0 : _window$app$__DEVELOP10.authorizeUrl,
122
+ location: location,
123
+ queryParams: {
124
+ reason: constants.LOGOUT_REASONS.UNAUTHORIZED,
125
+ // Query parameters for OIDC-lik workflow.
126
+ client_id: window.app.applicationId,
127
+ response_type: constants$1.OIDC_RESPONSE_TYPES.ID_TOKEN,
128
+ scope: requestedScope,
129
+ state: sessionId,
130
+ nonce: sessionId
131
+ }
132
+ });
133
+ }
134
+
135
+ const mcOrigin = servedByProxy ? getMcOrigin.getMcOrigin(window.app.mcApiUrl) : undefined;
136
+ return jsxRuntime.jsx(redirector.Redirector, {
137
+ to: "login",
138
+ origin: mcOrigin,
139
+ location: location,
140
+ queryParams: {
141
+ reason: constants.LOGOUT_REASONS.UNAUTHORIZED,
142
+ redirectTo: urlUtils.trimLeadingAndTrailingSlashes(urlUtils.joinPaths(window.location.origin, location.pathname))
143
+ }
144
+ });
145
+ };
146
+
147
+ RedirectToLogin.displayName = 'RedirectToLogin';
148
+
149
+ exports["default"] = RedirectToLogin;
@@ -0,0 +1,147 @@
1
+ import { useLocation } from 'react-router-dom';
2
+ import { v4 } from 'uuid';
3
+ import { LOGOUT_REASONS } from '@commercetools-frontend/constants';
4
+ import { trimLeadingAndTrailingSlashes, joinPaths } from '@commercetools-frontend/url-utils';
5
+ import { b as OIDC_RESPONSE_TYPES } from './constants-7f04db3f.esm.js';
6
+ import { u as useIsServedByProxy } from './use-is-served-by-proxy-499bfa16.esm.js';
7
+ import { g as getMcOrigin } from './get-mc-origin-5df60933.esm.js';
8
+ import { b as buildOidcScope } from './oidc-10fa96f0.esm.js';
9
+ import { b as getActiveProjectKey, p as setSessionScope, q as setSessionState } from './configure-apollo-5f1fd942.esm.js';
10
+ import { R as Redirector } from './redirector-47a6be71.esm.js';
11
+ import { jsx } from '@emotion/react/jsx-runtime';
12
+ import '@commercetools-frontend/application-shell-connectors';
13
+ import '@babel/runtime-corejs3/helpers/slicedToArray';
14
+ import '@babel/runtime-corejs3/core-js-stable/url';
15
+ import '@babel/runtime-corejs3/core-js-stable/instance/reverse';
16
+ import '@babel/runtime-corejs3/core-js-stable/instance/concat';
17
+ import '@babel/runtime-corejs3/core-js-stable/instance/map';
18
+ import '@babel/runtime-corejs3/core-js-stable/instance/for-each';
19
+ import '@babel/runtime-corejs3/core-js-stable/object/keys';
20
+ import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
21
+ import '@babel/runtime-corejs3/core-js-stable/instance/filter';
22
+ import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
23
+ import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
24
+ import '@babel/runtime-corejs3/core-js-stable/object/define-properties';
25
+ import '@babel/runtime-corejs3/core-js-stable/object/define-property';
26
+ import '@babel/runtime-corejs3/helpers/defineProperty';
27
+ import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
28
+ import '@babel/runtime-corejs3/core-js-stable/object/entries';
29
+ import '@babel/runtime-corejs3/core-js-stable/reflect/has';
30
+ import '@reduxjs/toolkit';
31
+ import 'lodash/mapValues';
32
+ import 'omit-empty-es';
33
+ import 'redux-thunk';
34
+ import '@commercetools-frontend/notifications';
35
+ import '@commercetools-frontend/sdk';
36
+ import 'react';
37
+ import '@babel/runtime-corejs3/core-js-stable/instance/index-of';
38
+ import '@babel/runtime-corejs3/core-js-stable/instance/slice';
39
+ import '@babel/runtime-corejs3/core-js-stable/instance/includes';
40
+ import '@commercetools-frontend/sentry';
41
+ import '@commercetools-frontend/react-notifications';
42
+ import '@babel/runtime-corejs3/core-js-stable/instance/starts-with';
43
+ import 'redux-logger';
44
+ import '@babel/runtime-corejs3/core-js-stable/instance/find';
45
+ import '@apollo/client';
46
+ import 'apollo-link-logger';
47
+ import '@apollo/client/link/error';
48
+ import '@commercetools-frontend/browser-history';
49
+ import '@babel/runtime-corejs3/core-js-stable/array/is-array';
50
+ import '@babel/runtime-corejs3/core-js-stable/instance/some';
51
+ import '@babel/runtime-corejs3/core-js-stable/object/values';
52
+ import '@commercetools/http-user-agent';
53
+ import '@babel/runtime-corejs3/core-js-stable/reflect/construct';
54
+ import '@babel/runtime-corejs3/helpers/createClass';
55
+ import '@babel/runtime-corejs3/helpers/classCallCheck';
56
+ import '@babel/runtime-corejs3/helpers/assertThisInitialized';
57
+ import '@babel/runtime-corejs3/helpers/inherits';
58
+ import '@babel/runtime-corejs3/helpers/possibleConstructorReturn';
59
+ import '@babel/runtime-corejs3/helpers/getPrototypeOf';
60
+ import '@babel/runtime-corejs3/helpers/wrapNativeSuper';
61
+ import '@babel/runtime-corejs3/core-js-stable/json/stringify';
62
+ import '@apollo/client/link/retry';
63
+ import 'prop-types';
64
+ import 'qss';
65
+
66
+ const generateAndCacheNonceWithState = state => {
67
+ const nonce = v4(); // We store additional information within the given `nonce`
68
+ // to then retrieve it later when the IdP redirects back
69
+ // to our application. The URL will contain the `nonce` within
70
+ // the id_token and, once validated, we can retrieve and use
71
+ // the state object.
72
+ // https://auth0.com/docs/protocols/oauth2/oauth-state#how-to-use-the-parameter-to-restore-application-state
73
+
74
+ setSessionState(nonce, state);
75
+ return nonce;
76
+ };
77
+
78
+ const RedirectToLogin = () => {
79
+ var _window$app$__DEVELOP, _window$app$__DEVELOP2;
80
+
81
+ const location = useLocation();
82
+ const servedByProxy = useIsServedByProxy();
83
+
84
+ if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP2 = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP2 !== void 0 && _window$app$__DEVELOP2.authorizeUrl) {
85
+ var _window$app$__DEVELOP3, _window$app$__DEVELOP4, _window$app$__DEVELOP5, _window$app$__DEVELOP6, _window$app$__DEVELOP7, _window$app$__DEVELOP8, _window$app$__DEVELOP9, _window$app$__DEVELOP10;
86
+
87
+ // We pick the project key from local storage. This assumes that the value
88
+ // as been previously set when the application starts up.
89
+ // This is necessary to allow switching projects and triggering a new login.
90
+ const nextProjectKey = getActiveProjectKey(); // According to the OIDC spec, the `state` parameter is recommended to be sent
91
+ // to the authorization server to help mitigating Cross-Site Request Forgery.
92
+ // https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
93
+ // Using `state` or `nonce` is very similar but with subtle differences.
94
+ // Here we follow the approach described by Auth0 on how to use both, where
95
+ // we generate a `nonce`, store it in session storage together with some state,
96
+ // and send it to the authorization server as the `state` parameter.
97
+ // https://auth0.com/docs/protocols/oauth2/redirect-users
98
+ // Additionally, we still send the `nonce` parameter as well.
99
+
100
+ const sessionId = generateAndCacheNonceWithState({
101
+ applicationId: window.app.applicationId,
102
+ // Store query parameters to be used after the callback redirect
103
+ query: {
104
+ redirectTo: nextProjectKey ? "/".concat(nextProjectKey) : '/'
105
+ }
106
+ });
107
+ const requestedScope = buildOidcScope({
108
+ projectKey: nextProjectKey !== null && nextProjectKey !== void 0 ? nextProjectKey : undefined,
109
+ oAuthScopes: (_window$app$__DEVELOP3 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP3 === void 0 ? void 0 : (_window$app$__DEVELOP4 = _window$app$__DEVELOP3.oidc) === null || _window$app$__DEVELOP4 === void 0 ? void 0 : _window$app$__DEVELOP4.oAuthScopes,
110
+ additionalOAuthScopes: (_window$app$__DEVELOP5 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP5 === void 0 ? void 0 : (_window$app$__DEVELOP6 = _window$app$__DEVELOP5.oidc) === null || _window$app$__DEVELOP6 === void 0 ? void 0 : _window$app$__DEVELOP6.additionalOAuthScopes,
111
+ teamId: (_window$app$__DEVELOP7 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP7 === void 0 ? void 0 : (_window$app$__DEVELOP8 = _window$app$__DEVELOP7.oidc) === null || _window$app$__DEVELOP8 === void 0 ? void 0 : _window$app$__DEVELOP8.teamId
112
+ }); // Store session scopes, to be able to detect if requested scopes changed
113
+ // in the application config and invalidate the session.
114
+ // This is only valid for local development.
115
+
116
+ setSessionScope(requestedScope);
117
+ return jsx(Redirector, {
118
+ to: "",
119
+ origin: (_window$app$__DEVELOP9 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP9 === void 0 ? void 0 : (_window$app$__DEVELOP10 = _window$app$__DEVELOP9.oidc) === null || _window$app$__DEVELOP10 === void 0 ? void 0 : _window$app$__DEVELOP10.authorizeUrl,
120
+ location: location,
121
+ queryParams: {
122
+ reason: LOGOUT_REASONS.UNAUTHORIZED,
123
+ // Query parameters for OIDC-lik workflow.
124
+ client_id: window.app.applicationId,
125
+ response_type: OIDC_RESPONSE_TYPES.ID_TOKEN,
126
+ scope: requestedScope,
127
+ state: sessionId,
128
+ nonce: sessionId
129
+ }
130
+ });
131
+ }
132
+
133
+ const mcOrigin = servedByProxy ? getMcOrigin(window.app.mcApiUrl) : undefined;
134
+ return jsx(Redirector, {
135
+ to: "login",
136
+ origin: mcOrigin,
137
+ location: location,
138
+ queryParams: {
139
+ reason: LOGOUT_REASONS.UNAUTHORIZED,
140
+ redirectTo: trimLeadingAndTrailingSlashes(joinPaths(window.location.origin, location.pathname))
141
+ }
142
+ });
143
+ };
144
+
145
+ RedirectToLogin.displayName = 'RedirectToLogin';
146
+
147
+ export { RedirectToLogin as default };
@@ -0,0 +1,138 @@
1
+ import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
2
+ import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
3
+ import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
4
+ import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
5
+ import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
6
+ import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
7
+ import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties';
8
+ import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
9
+ import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
10
+ import { useLocation } from 'react-router-dom';
11
+ import { LOGOUT_REASONS } from '@commercetools-frontend/constants';
12
+ import { u as useIsServedByProxy } from './use-is-served-by-proxy-499bfa16.esm.js';
13
+ import { g as getMcOrigin } from './get-mc-origin-5df60933.esm.js';
14
+ import { t as clearSession } from './configure-apollo-5f1fd942.esm.js';
15
+ import { R as RedirectToLogin } from './index-b002eca6.esm.js';
16
+ import { R as Redirector } from './redirector-47a6be71.esm.js';
17
+ import { jsx } from '@emotion/react/jsx-runtime';
18
+ import '@commercetools-frontend/application-shell-connectors';
19
+ import '@babel/runtime-corejs3/helpers/slicedToArray';
20
+ import '@babel/runtime-corejs3/core-js-stable/url';
21
+ import '@babel/runtime-corejs3/core-js-stable/instance/reverse';
22
+ import '@babel/runtime-corejs3/core-js-stable/instance/reduce';
23
+ import '@babel/runtime-corejs3/core-js-stable/object/entries';
24
+ import '@babel/runtime-corejs3/core-js-stable/reflect/has';
25
+ import '@reduxjs/toolkit';
26
+ import 'lodash/mapValues';
27
+ import 'omit-empty-es';
28
+ import 'redux-thunk';
29
+ import '@commercetools-frontend/notifications';
30
+ import '@commercetools-frontend/sdk';
31
+ import 'react';
32
+ import '@babel/runtime-corejs3/core-js-stable/instance/index-of';
33
+ import '@babel/runtime-corejs3/core-js-stable/instance/slice';
34
+ import '@babel/runtime-corejs3/core-js-stable/instance/includes';
35
+ import '@commercetools-frontend/sentry';
36
+ import './constants-7f04db3f.esm.js';
37
+ import '@commercetools-frontend/react-notifications';
38
+ import '@babel/runtime-corejs3/core-js-stable/instance/starts-with';
39
+ import 'redux-logger';
40
+ import '@babel/runtime-corejs3/core-js-stable/instance/concat';
41
+ import '@babel/runtime-corejs3/core-js-stable/instance/find';
42
+ import '@apollo/client';
43
+ import 'apollo-link-logger';
44
+ import '@apollo/client/link/error';
45
+ import '@commercetools-frontend/browser-history';
46
+ import '@babel/runtime-corejs3/core-js-stable/array/is-array';
47
+ import '@babel/runtime-corejs3/core-js-stable/instance/some';
48
+ import '@babel/runtime-corejs3/core-js-stable/object/values';
49
+ import '@babel/runtime-corejs3/core-js-stable/instance/map';
50
+ import '@commercetools/http-user-agent';
51
+ import 'uuid';
52
+ import '@babel/runtime-corejs3/core-js-stable/reflect/construct';
53
+ import '@babel/runtime-corejs3/helpers/createClass';
54
+ import '@babel/runtime-corejs3/helpers/classCallCheck';
55
+ import '@babel/runtime-corejs3/helpers/assertThisInitialized';
56
+ import '@babel/runtime-corejs3/helpers/inherits';
57
+ import '@babel/runtime-corejs3/helpers/possibleConstructorReturn';
58
+ import '@babel/runtime-corejs3/helpers/getPrototypeOf';
59
+ import '@babel/runtime-corejs3/helpers/wrapNativeSuper';
60
+ import '@babel/runtime-corejs3/core-js-stable/json/stringify';
61
+ import '@apollo/client/link/retry';
62
+ import 'prop-types';
63
+ import '@emotion/styled/base';
64
+ import '@emotion/react';
65
+ import '@commercetools-frontend/application-components';
66
+ import '@commercetools-frontend/i18n';
67
+ import '@commercetools-frontend/assets/images/logo.svg';
68
+ import '@commercetools-uikit/design-system';
69
+ import '@commercetools-uikit/spacings';
70
+ import 'react-intl';
71
+ import '@commercetools-uikit/flat-button';
72
+ import '@commercetools-uikit/icons';
73
+ import '@babel/runtime-corejs3/helpers/taggedTemplateLiteral';
74
+ import '@babel/runtime-corejs3/helpers/objectWithoutProperties';
75
+ import 'memoize-one';
76
+ import '@commercetools-uikit/accessible-hidden';
77
+ import '@commercetools-uikit/select-input';
78
+ import '@apollo/client/react';
79
+ import '@commercetools-frontend/assets/images/ct-logo.svg';
80
+ import '@commercetools-uikit/loading-spinner';
81
+ import '@commercetools-frontend/l10n';
82
+ import 'lodash/camelCase';
83
+ import '@babel/runtime-corejs3/core-js-stable/array/from';
84
+ import '@babel/runtime-corejs3/core-js-stable/instance/every';
85
+ import '@flopflip/react-broadcast';
86
+ import 'classnames';
87
+ import '@commercetools-frontend/assets/images/diagonal-line.svg';
88
+ import '@commercetools-frontend/permissions';
89
+ import '@commercetools-uikit/icons/inline-svg';
90
+ import 'lodash/isNil';
91
+ import '@babel/runtime-corejs3/core-js-stable/object/from-entries';
92
+ import '@babel/runtime-corejs3/core-js-stable/instance/flags';
93
+ import '@flopflip/combine-adapters';
94
+ import '@flopflip/http-adapter';
95
+ import '@flopflip/launchdarkly-adapter';
96
+ import 'perfume.js';
97
+ import 'react-redux';
98
+ import 'lodash/upperFirst';
99
+ import './oidc-10fa96f0.esm.js';
100
+ import '@commercetools-uikit/design-system/materials/resets.css';
101
+ import '@commercetools-frontend/actions-global';
102
+ import '@commercetools-frontend/application-config/ssr';
103
+ import 'qss';
104
+
105
+ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
106
+
107
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
108
+
109
+ // When the application redirects to this route, we always force a hard redirect
110
+ // to the logout route of the authentication service.
111
+ const RedirectToLogout = props => {
112
+ var _window$app$__DEVELOP, _window$app$__DEVELOP2, _props$reason;
113
+
114
+ const location = useLocation();
115
+ const servedByProxy = useIsServedByProxy();
116
+
117
+ if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP2 = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP2 !== void 0 && _window$app$__DEVELOP2.authorizeUrl) {
118
+ // Remove the `sessionToken` from storage, so that the AppShell can initiate
119
+ // a new authorization flow.
120
+ clearSession();
121
+ return jsx(RedirectToLogin, {});
122
+ }
123
+
124
+ const mcOrigin = servedByProxy ? getMcOrigin(window.app.mcApiUrl) : undefined;
125
+ return jsx(Redirector, {
126
+ to: "logout",
127
+ origin: mcOrigin,
128
+ location: location,
129
+ queryParams: _objectSpread({
130
+ reason: (_props$reason = props.reason) !== null && _props$reason !== void 0 ? _props$reason : LOGOUT_REASONS.USER
131
+ }, servedByProxy ? {} : {
132
+ // This will be used after being logged in, to redirect to this location.
133
+ redirectTo: window.location.origin
134
+ })
135
+ });
136
+ };
137
+
138
+ export { RedirectToLogout as default };