@commercetools-frontend/application-shell 22.14.2 → 22.15.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 (71) hide show
  1. package/dist/commercetools-frontend-application-shell.cjs.dev.js +1 -1
  2. package/dist/commercetools-frontend-application-shell.cjs.prod.js +1 -1
  3. package/dist/commercetools-frontend-application-shell.esm.js +1 -1
  4. package/dist/{custom-view-dev-host-263f2c1a.cjs.dev.js → custom-view-dev-host-0f62a220.cjs.dev.js} +1 -1
  5. package/dist/custom-view-dev-host-714c9d65.cjs.prod.js +203 -0
  6. package/dist/{custom-view-dev-host-c295f899.esm.js → custom-view-dev-host-e3c2a970.esm.js} +1 -1
  7. package/dist/declarations/src/components/authenticated/oidc-callback.async.d.ts +1 -1
  8. package/dist/declarations/src/components/authenticated/oidc-callback.d.ts +1 -1
  9. package/dist/declarations/src/components/navbar/menu-items.d.ts +4 -4
  10. package/dist/declarations/src/components/navbar/use-navbar-state-manager.d.ts +1 -1
  11. package/dist/declarations/src/components/redirect-to-login/index.d.ts +1 -1
  12. package/dist/declarations/src/components/redirect-to-login/redirect-to-login.d.ts +1 -1
  13. package/dist/declarations/src/components/redirector/index.d.ts +1 -1
  14. package/dist/declarations/src/components/redirector/redirector.d.ts +6 -5
  15. package/dist/{index-a7493b61.cjs.prod.js → index-08c8fcb3.cjs.prod.js} +107 -57
  16. package/dist/{index-315660b0.esm.js → index-4eee2222.esm.js} +105 -70
  17. package/dist/{index-ae1eae7e.cjs.dev.js → index-97ddc7b1.cjs.dev.js} +103 -68
  18. package/dist/navbar-5a1b9a06.esm.js +1223 -0
  19. package/dist/navbar-a5342082.cjs.dev.js +1256 -0
  20. package/dist/{navbar-be902d73.cjs.prod.js → navbar-d60f807a.cjs.prod.js} +38 -8
  21. package/dist/{oidc-callback-f120d63c.esm.js → oidc-callback-621a8bd2.esm.js} +69 -48
  22. package/dist/{oidc-callback-b397bd00.cjs.prod.js → oidc-callback-f70d9fd1.cjs.prod.js} +66 -47
  23. package/dist/{oidc-callback-77adc650.cjs.dev.js → oidc-callback-fa62a3ca.cjs.dev.js} +70 -48
  24. package/dist/{project-container-c014c0c5.cjs.dev.js → project-container-2751a67a.cjs.dev.js} +5 -5
  25. package/dist/{project-container-68403e75.esm.js → project-container-b2a1fd66.esm.js} +5 -5
  26. package/dist/{project-container-9cfe3aa6.cjs.prod.js → project-container-e657827e.cjs.prod.js} +5 -5
  27. package/dist/{project-expired-9b37e7be.cjs.prod.js → project-expired-085f8e5a.cjs.prod.js} +2 -2
  28. package/dist/{project-expired-2f27ca0a.esm.js → project-expired-09e4078a.esm.js} +2 -2
  29. package/dist/{project-expired-be7a7c1e.cjs.dev.js → project-expired-cb7e26ef.cjs.dev.js} +2 -2
  30. package/dist/{project-not-found-43dadcef.esm.js → project-not-found-13cd7767.esm.js} +2 -2
  31. package/dist/{project-not-found-a2e74c89.cjs.prod.js → project-not-found-2f6dc5d2.cjs.prod.js} +2 -2
  32. package/dist/{project-not-found-96cdb368.cjs.dev.js → project-not-found-7646a1ee.cjs.dev.js} +2 -2
  33. package/dist/{project-not-initialized-8e84d5c7.esm.js → project-not-initialized-74f4384a.esm.js} +2 -2
  34. package/dist/{project-not-initialized-ffaffeb0.cjs.prod.js → project-not-initialized-9694ef3e.cjs.prod.js} +2 -2
  35. package/dist/{project-not-initialized-362155ca.cjs.dev.js → project-not-initialized-e40d16f2.cjs.dev.js} +2 -2
  36. package/dist/{project-suspended-61e02b61.cjs.dev.js → project-suspended-55f2ac4f.cjs.dev.js} +2 -2
  37. package/dist/{project-suspended-37db98bf.cjs.prod.js → project-suspended-f5463061.cjs.prod.js} +2 -2
  38. package/dist/{project-suspended-c03a9e61.esm.js → project-suspended-f9999215.esm.js} +2 -2
  39. package/dist/{quick-access-6226709e.esm.js → quick-access-6cd9b3ba.esm.js} +1 -1
  40. package/dist/{quick-access-68c00be3.cjs.dev.js → quick-access-8314ffe5.cjs.dev.js} +1 -1
  41. package/dist/{quick-access-cffc290d.cjs.prod.js → quick-access-c9f75955.cjs.prod.js} +1 -1
  42. package/dist/redirect-to-login-5e148cff.esm.js +118 -0
  43. package/dist/redirect-to-login-d2287ced.cjs.dev.js +120 -0
  44. package/dist/redirect-to-login-e4f2ca07.cjs.prod.js +120 -0
  45. package/dist/{redirect-to-logout-fa06e640.cjs.dev.js → redirect-to-logout-a4bc80a6.cjs.dev.js} +3 -6
  46. package/dist/{redirect-to-logout-22708e37.cjs.prod.js → redirect-to-logout-cdcb00b1.cjs.prod.js} +3 -6
  47. package/dist/{redirect-to-logout-aa665ef1.esm.js → redirect-to-logout-ed7cd66d.esm.js} +3 -6
  48. package/dist/redirect-to-project-create-1d0c6b01.esm.js +59 -0
  49. package/dist/redirect-to-project-create-67d7cd03.cjs.dev.js +67 -0
  50. package/dist/redirect-to-project-create-c962f72f.cjs.prod.js +67 -0
  51. package/dist/{redirector-752b4efc.cjs.prod.js → redirector-15844d9b.cjs.prod.js} +22 -12
  52. package/dist/{redirector-db8b5cd2.esm.js → redirector-54a03b75.esm.js} +23 -14
  53. package/dist/{redirector-5daa8baa.cjs.dev.js → redirector-fcdeaba7.cjs.dev.js} +22 -12
  54. package/dist/{requests-in-flight-loader-df11d5fc.cjs.dev.js → requests-in-flight-loader-097bfc28.cjs.dev.js} +1 -1
  55. package/dist/{requests-in-flight-loader-c30b0762.esm.js → requests-in-flight-loader-e5951187.esm.js} +1 -1
  56. package/dist/{requests-in-flight-loader-2f004196.cjs.prod.js → requests-in-flight-loader-f584e80c.cjs.prod.js} +1 -1
  57. package/dist/{service-page-project-switcher-ae6d1775.cjs.dev.js → service-page-project-switcher-8f694816.cjs.dev.js} +1 -1
  58. package/dist/{service-page-project-switcher-65c553fa.esm.js → service-page-project-switcher-90efcfbc.esm.js} +1 -1
  59. package/dist/{service-page-project-switcher-4818f8e5.cjs.prod.js → service-page-project-switcher-cc8cab71.cjs.prod.js} +1 -1
  60. package/dist/{version-tracker-4b5032f1.esm.js → version-tracker-46a3f021.esm.js} +1 -1
  61. package/dist/{version-tracker-e5b7b2ae.cjs.dev.js → version-tracker-9976ad26.cjs.dev.js} +1 -1
  62. package/dist/{version-tracker-a3a9dd53.cjs.prod.js → version-tracker-a3eb5a8e.cjs.prod.js} +1 -1
  63. package/package.json +16 -16
  64. package/dist/navbar-8409df86.cjs.dev.js +0 -1226
  65. package/dist/navbar-e4559c93.esm.js +0 -1193
  66. package/dist/redirect-to-login-573b012a.cjs.prod.js +0 -109
  67. package/dist/redirect-to-login-dffecd53.cjs.dev.js +0 -109
  68. package/dist/redirect-to-login-e569bd46.esm.js +0 -107
  69. package/dist/redirect-to-project-create-2266c427.cjs.prod.js +0 -59
  70. package/dist/redirect-to-project-create-7b476aa6.cjs.dev.js +0 -59
  71. package/dist/redirect-to-project-create-c5323504.esm.js +0 -50
@@ -1,109 +0,0 @@
1
- 'use strict';
2
-
3
- var reactRouterDom = require('react-router-dom');
4
- var uuid = require('uuid');
5
- var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
6
- var constants = require('@commercetools-frontend/constants');
7
- var urlUtils = require('@commercetools-frontend/url-utils');
8
- var oidc = require('./oidc-b070ff6c.cjs.prod.js');
9
- var useIsServedByProxy = require('./use-is-served-by-proxy-845cace5.cjs.prod.js');
10
- var getMcOrigin = require('./get-mc-origin-8f7a578c.cjs.prod.js');
11
- var redirector = require('./redirector-752b4efc.cjs.prod.js');
12
- var jsxRuntime = require('@emotion/react/jsx-runtime');
13
- require('@babel/runtime-corejs3/core-js-stable/instance/concat');
14
- require('@babel/runtime-corejs3/core-js-stable/instance/map');
15
- require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
16
- require('@babel/runtime-corejs3/helpers/slicedToArray');
17
- require('@babel/runtime-corejs3/core-js-stable/url');
18
- require('@babel/runtime-corejs3/core-js-stable/instance/reverse');
19
- require('@babel/runtime-corejs3/core-js-stable/object/keys');
20
- require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
21
- require('@babel/runtime-corejs3/core-js-stable/instance/filter');
22
- require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
23
- require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
24
- require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
25
- require('@babel/runtime-corejs3/core-js-stable/object/define-property');
26
- require('@babel/runtime-corejs3/helpers/defineProperty');
27
- require('prop-types');
28
- require('react');
29
- require('qss');
30
-
31
- const generateAndCacheNonceWithState = state => {
32
- const nonce = uuid.v4();
33
- // We store additional information within the given `nonce`
34
- // to then retrieve it later when the IdP redirects back
35
- // to our application. The URL will contain the `nonce` within
36
- // the id_token and, once validated, we can retrieve and use
37
- // the state object.
38
- // https://auth0.com/docs/protocols/oauth2/oauth-state#how-to-use-the-parameter-to-restore-application-state
39
- applicationShellConnectors.oidcStorage.setSessionState(nonce, state);
40
- return nonce;
41
- };
42
- const RedirectToLogin = () => {
43
- var _window$app$__DEVELOP;
44
- const location = reactRouterDom.useLocation();
45
- const servedByProxy = useIsServedByProxy.useIsServedByProxy();
46
- if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP !== void 0 && _window$app$__DEVELOP.authorizeUrl) {
47
- var _window$app$__DEVELOP2, _window$app$__DEVELOP3, _window$app$__DEVELOP4, _window$app$__DEVELOP5, _window$app$__DEVELOP6;
48
- // We pick the project key from local storage. This assumes that the value
49
- // as been previously set when the application starts up.
50
- // This is necessary to allow switching projects and triggering a new login.
51
- const nextProjectKey = applicationShellConnectors.oidcStorage.getActiveProjectKey();
52
-
53
- // According to the OIDC spec, the `state` parameter is recommended to be sent
54
- // to the authorization server to help mitigating Cross-Site Request Forgery.
55
- // https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
56
- // Using `state` or `nonce` is very similar but with subtle differences.
57
- // Here we follow the approach described by Auth0 on how to use both, where
58
- // we generate a `nonce`, store it in session storage together with some state,
59
- // and send it to the authorization server as the `state` parameter.
60
- // https://auth0.com/docs/protocols/oauth2/redirect-users
61
- // Additionally, we still send the `nonce` parameter as well.
62
- const sessionId = generateAndCacheNonceWithState({
63
- applicationId: window.app.applicationId,
64
- // Store query parameters to be used after the callback redirect
65
- query: {
66
- redirectTo: nextProjectKey ? "/".concat(nextProjectKey) : '/'
67
- }
68
- });
69
- const requestedScope = oidc.buildOidcScope({
70
- projectKey: nextProjectKey !== null && nextProjectKey !== void 0 ? nextProjectKey : undefined,
71
- oAuthScopes: (_window$app$__DEVELOP2 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP2 === void 0 || (_window$app$__DEVELOP2 = _window$app$__DEVELOP2.oidc) === null || _window$app$__DEVELOP2 === void 0 ? void 0 : _window$app$__DEVELOP2.oAuthScopes,
72
- additionalOAuthScopes: (_window$app$__DEVELOP3 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP3 === void 0 || (_window$app$__DEVELOP3 = _window$app$__DEVELOP3.oidc) === null || _window$app$__DEVELOP3 === void 0 ? void 0 : _window$app$__DEVELOP3.additionalOAuthScopes,
73
- teamId: (_window$app$__DEVELOP4 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP4 === void 0 || (_window$app$__DEVELOP4 = _window$app$__DEVELOP4.oidc) === null || _window$app$__DEVELOP4 === void 0 ? void 0 : _window$app$__DEVELOP4.teamId,
74
- applicationId: (_window$app$__DEVELOP5 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP5 === void 0 || (_window$app$__DEVELOP5 = _window$app$__DEVELOP5.oidc) === null || _window$app$__DEVELOP5 === void 0 ? void 0 : _window$app$__DEVELOP5.applicationId
75
- });
76
-
77
- // Store session scopes, to be able to detect if requested scopes changed
78
- // in the application config and invalidate the session.
79
- // This is only valid for local development.
80
- applicationShellConnectors.oidcStorage.setSessionScope(requestedScope);
81
- return jsxRuntime.jsx(redirector.Redirector, {
82
- to: "",
83
- origin: (_window$app$__DEVELOP6 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP6 === void 0 || (_window$app$__DEVELOP6 = _window$app$__DEVELOP6.oidc) === null || _window$app$__DEVELOP6 === void 0 ? void 0 : _window$app$__DEVELOP6.authorizeUrl,
84
- location: location,
85
- queryParams: {
86
- reason: constants.LOGOUT_REASONS.UNAUTHORIZED,
87
- // Query parameters for OIDC-lik workflow.
88
- client_id: window.app.applicationId,
89
- response_type: oidc.OIDC_RESPONSE_TYPES.ID_TOKEN,
90
- scope: requestedScope,
91
- state: sessionId,
92
- nonce: sessionId
93
- }
94
- });
95
- }
96
- const mcOrigin = servedByProxy ? getMcOrigin.getMcOrigin(window.app.mcApiUrl) : undefined;
97
- return jsxRuntime.jsx(redirector.Redirector, {
98
- to: "login",
99
- origin: mcOrigin,
100
- location: location,
101
- queryParams: {
102
- reason: constants.LOGOUT_REASONS.UNAUTHORIZED,
103
- redirectTo: urlUtils.trimLeadingAndTrailingSlashes(urlUtils.joinPaths(window.location.origin, location.pathname))
104
- }
105
- });
106
- };
107
- RedirectToLogin.displayName = 'RedirectToLogin';
108
-
109
- exports["default"] = RedirectToLogin;
@@ -1,109 +0,0 @@
1
- 'use strict';
2
-
3
- var reactRouterDom = require('react-router-dom');
4
- var uuid = require('uuid');
5
- var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
6
- var constants = require('@commercetools-frontend/constants');
7
- var urlUtils = require('@commercetools-frontend/url-utils');
8
- var oidc = require('./oidc-7c48215c.cjs.dev.js');
9
- var useIsServedByProxy = require('./use-is-served-by-proxy-ed411f45.cjs.dev.js');
10
- var getMcOrigin = require('./get-mc-origin-a86dff20.cjs.dev.js');
11
- var redirector = require('./redirector-5daa8baa.cjs.dev.js');
12
- var jsxRuntime = require('@emotion/react/jsx-runtime');
13
- require('@babel/runtime-corejs3/core-js-stable/instance/concat');
14
- require('@babel/runtime-corejs3/core-js-stable/instance/map');
15
- require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
16
- require('@babel/runtime-corejs3/helpers/slicedToArray');
17
- require('@babel/runtime-corejs3/core-js-stable/url');
18
- require('@babel/runtime-corejs3/core-js-stable/instance/reverse');
19
- require('@babel/runtime-corejs3/core-js-stable/object/keys');
20
- require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
21
- require('@babel/runtime-corejs3/core-js-stable/instance/filter');
22
- require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
23
- require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
24
- require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
25
- require('@babel/runtime-corejs3/core-js-stable/object/define-property');
26
- require('@babel/runtime-corejs3/helpers/defineProperty');
27
- require('prop-types');
28
- require('react');
29
- require('qss');
30
-
31
- const generateAndCacheNonceWithState = state => {
32
- const nonce = uuid.v4();
33
- // We store additional information within the given `nonce`
34
- // to then retrieve it later when the IdP redirects back
35
- // to our application. The URL will contain the `nonce` within
36
- // the id_token and, once validated, we can retrieve and use
37
- // the state object.
38
- // https://auth0.com/docs/protocols/oauth2/oauth-state#how-to-use-the-parameter-to-restore-application-state
39
- applicationShellConnectors.oidcStorage.setSessionState(nonce, state);
40
- return nonce;
41
- };
42
- const RedirectToLogin = () => {
43
- var _window$app$__DEVELOP;
44
- const location = reactRouterDom.useLocation();
45
- const servedByProxy = useIsServedByProxy.useIsServedByProxy();
46
- if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP !== void 0 && _window$app$__DEVELOP.authorizeUrl) {
47
- var _window$app$__DEVELOP2, _window$app$__DEVELOP3, _window$app$__DEVELOP4, _window$app$__DEVELOP5, _window$app$__DEVELOP6;
48
- // We pick the project key from local storage. This assumes that the value
49
- // as been previously set when the application starts up.
50
- // This is necessary to allow switching projects and triggering a new login.
51
- const nextProjectKey = applicationShellConnectors.oidcStorage.getActiveProjectKey();
52
-
53
- // According to the OIDC spec, the `state` parameter is recommended to be sent
54
- // to the authorization server to help mitigating Cross-Site Request Forgery.
55
- // https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
56
- // Using `state` or `nonce` is very similar but with subtle differences.
57
- // Here we follow the approach described by Auth0 on how to use both, where
58
- // we generate a `nonce`, store it in session storage together with some state,
59
- // and send it to the authorization server as the `state` parameter.
60
- // https://auth0.com/docs/protocols/oauth2/redirect-users
61
- // Additionally, we still send the `nonce` parameter as well.
62
- const sessionId = generateAndCacheNonceWithState({
63
- applicationId: window.app.applicationId,
64
- // Store query parameters to be used after the callback redirect
65
- query: {
66
- redirectTo: nextProjectKey ? "/".concat(nextProjectKey) : '/'
67
- }
68
- });
69
- const requestedScope = oidc.buildOidcScope({
70
- projectKey: nextProjectKey !== null && nextProjectKey !== void 0 ? nextProjectKey : undefined,
71
- oAuthScopes: (_window$app$__DEVELOP2 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP2 === void 0 || (_window$app$__DEVELOP2 = _window$app$__DEVELOP2.oidc) === null || _window$app$__DEVELOP2 === void 0 ? void 0 : _window$app$__DEVELOP2.oAuthScopes,
72
- additionalOAuthScopes: (_window$app$__DEVELOP3 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP3 === void 0 || (_window$app$__DEVELOP3 = _window$app$__DEVELOP3.oidc) === null || _window$app$__DEVELOP3 === void 0 ? void 0 : _window$app$__DEVELOP3.additionalOAuthScopes,
73
- teamId: (_window$app$__DEVELOP4 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP4 === void 0 || (_window$app$__DEVELOP4 = _window$app$__DEVELOP4.oidc) === null || _window$app$__DEVELOP4 === void 0 ? void 0 : _window$app$__DEVELOP4.teamId,
74
- applicationId: (_window$app$__DEVELOP5 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP5 === void 0 || (_window$app$__DEVELOP5 = _window$app$__DEVELOP5.oidc) === null || _window$app$__DEVELOP5 === void 0 ? void 0 : _window$app$__DEVELOP5.applicationId
75
- });
76
-
77
- // Store session scopes, to be able to detect if requested scopes changed
78
- // in the application config and invalidate the session.
79
- // This is only valid for local development.
80
- applicationShellConnectors.oidcStorage.setSessionScope(requestedScope);
81
- return jsxRuntime.jsx(redirector.Redirector, {
82
- to: "",
83
- origin: (_window$app$__DEVELOP6 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP6 === void 0 || (_window$app$__DEVELOP6 = _window$app$__DEVELOP6.oidc) === null || _window$app$__DEVELOP6 === void 0 ? void 0 : _window$app$__DEVELOP6.authorizeUrl,
84
- location: location,
85
- queryParams: {
86
- reason: constants.LOGOUT_REASONS.UNAUTHORIZED,
87
- // Query parameters for OIDC-lik workflow.
88
- client_id: window.app.applicationId,
89
- response_type: oidc.OIDC_RESPONSE_TYPES.ID_TOKEN,
90
- scope: requestedScope,
91
- state: sessionId,
92
- nonce: sessionId
93
- }
94
- });
95
- }
96
- const mcOrigin = servedByProxy ? getMcOrigin.getMcOrigin(window.app.mcApiUrl) : undefined;
97
- return jsxRuntime.jsx(redirector.Redirector, {
98
- to: "login",
99
- origin: mcOrigin,
100
- location: location,
101
- queryParams: {
102
- reason: constants.LOGOUT_REASONS.UNAUTHORIZED,
103
- redirectTo: urlUtils.trimLeadingAndTrailingSlashes(urlUtils.joinPaths(window.location.origin, location.pathname))
104
- }
105
- });
106
- };
107
- RedirectToLogin.displayName = 'RedirectToLogin';
108
-
109
- exports["default"] = RedirectToLogin;
@@ -1,107 +0,0 @@
1
- import { useLocation } from 'react-router-dom';
2
- import { v4 } from 'uuid';
3
- import { oidcStorage } from '@commercetools-frontend/application-shell-connectors';
4
- import { LOGOUT_REASONS } from '@commercetools-frontend/constants';
5
- import { trimLeadingAndTrailingSlashes, joinPaths } from '@commercetools-frontend/url-utils';
6
- import { b as buildOidcScope, a as OIDC_RESPONSE_TYPES } from './oidc-da8526e3.esm.js';
7
- import { u as useIsServedByProxy } from './use-is-served-by-proxy-77984220.esm.js';
8
- import { g as getMcOrigin } from './get-mc-origin-fecfee07.esm.js';
9
- import { R as Redirector } from './redirector-db8b5cd2.esm.js';
10
- import { jsx } from '@emotion/react/jsx-runtime';
11
- import '@babel/runtime-corejs3/core-js-stable/instance/concat';
12
- import '@babel/runtime-corejs3/core-js-stable/instance/map';
13
- import '@babel/runtime-corejs3/core-js-stable/instance/for-each';
14
- import '@babel/runtime-corejs3/helpers/slicedToArray';
15
- import '@babel/runtime-corejs3/core-js-stable/url';
16
- import '@babel/runtime-corejs3/core-js-stable/instance/reverse';
17
- import '@babel/runtime-corejs3/core-js-stable/object/keys';
18
- import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
19
- import '@babel/runtime-corejs3/core-js-stable/instance/filter';
20
- import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
21
- import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
22
- import '@babel/runtime-corejs3/core-js-stable/object/define-properties';
23
- import '@babel/runtime-corejs3/core-js-stable/object/define-property';
24
- import '@babel/runtime-corejs3/helpers/defineProperty';
25
- import 'prop-types';
26
- import 'react';
27
- import 'qss';
28
-
29
- const generateAndCacheNonceWithState = state => {
30
- const nonce = v4();
31
- // We store additional information within the given `nonce`
32
- // to then retrieve it later when the IdP redirects back
33
- // to our application. The URL will contain the `nonce` within
34
- // the id_token and, once validated, we can retrieve and use
35
- // the state object.
36
- // https://auth0.com/docs/protocols/oauth2/oauth-state#how-to-use-the-parameter-to-restore-application-state
37
- oidcStorage.setSessionState(nonce, state);
38
- return nonce;
39
- };
40
- const RedirectToLogin = () => {
41
- var _window$app$__DEVELOP;
42
- const location = useLocation();
43
- const servedByProxy = useIsServedByProxy();
44
- if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP !== void 0 && _window$app$__DEVELOP.authorizeUrl) {
45
- var _window$app$__DEVELOP2, _window$app$__DEVELOP3, _window$app$__DEVELOP4, _window$app$__DEVELOP5, _window$app$__DEVELOP6;
46
- // We pick the project key from local storage. This assumes that the value
47
- // as been previously set when the application starts up.
48
- // This is necessary to allow switching projects and triggering a new login.
49
- const nextProjectKey = oidcStorage.getActiveProjectKey();
50
-
51
- // According to the OIDC spec, the `state` parameter is recommended to be sent
52
- // to the authorization server to help mitigating Cross-Site Request Forgery.
53
- // https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
54
- // Using `state` or `nonce` is very similar but with subtle differences.
55
- // Here we follow the approach described by Auth0 on how to use both, where
56
- // we generate a `nonce`, store it in session storage together with some state,
57
- // and send it to the authorization server as the `state` parameter.
58
- // https://auth0.com/docs/protocols/oauth2/redirect-users
59
- // Additionally, we still send the `nonce` parameter as well.
60
- const sessionId = generateAndCacheNonceWithState({
61
- applicationId: window.app.applicationId,
62
- // Store query parameters to be used after the callback redirect
63
- query: {
64
- redirectTo: nextProjectKey ? "/".concat(nextProjectKey) : '/'
65
- }
66
- });
67
- const requestedScope = buildOidcScope({
68
- projectKey: nextProjectKey !== null && nextProjectKey !== void 0 ? nextProjectKey : undefined,
69
- oAuthScopes: (_window$app$__DEVELOP2 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP2 === void 0 || (_window$app$__DEVELOP2 = _window$app$__DEVELOP2.oidc) === null || _window$app$__DEVELOP2 === void 0 ? void 0 : _window$app$__DEVELOP2.oAuthScopes,
70
- additionalOAuthScopes: (_window$app$__DEVELOP3 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP3 === void 0 || (_window$app$__DEVELOP3 = _window$app$__DEVELOP3.oidc) === null || _window$app$__DEVELOP3 === void 0 ? void 0 : _window$app$__DEVELOP3.additionalOAuthScopes,
71
- teamId: (_window$app$__DEVELOP4 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP4 === void 0 || (_window$app$__DEVELOP4 = _window$app$__DEVELOP4.oidc) === null || _window$app$__DEVELOP4 === void 0 ? void 0 : _window$app$__DEVELOP4.teamId,
72
- applicationId: (_window$app$__DEVELOP5 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP5 === void 0 || (_window$app$__DEVELOP5 = _window$app$__DEVELOP5.oidc) === null || _window$app$__DEVELOP5 === void 0 ? void 0 : _window$app$__DEVELOP5.applicationId
73
- });
74
-
75
- // Store session scopes, to be able to detect if requested scopes changed
76
- // in the application config and invalidate the session.
77
- // This is only valid for local development.
78
- oidcStorage.setSessionScope(requestedScope);
79
- return jsx(Redirector, {
80
- to: "",
81
- origin: (_window$app$__DEVELOP6 = window.app.__DEVELOPMENT__) === null || _window$app$__DEVELOP6 === void 0 || (_window$app$__DEVELOP6 = _window$app$__DEVELOP6.oidc) === null || _window$app$__DEVELOP6 === void 0 ? void 0 : _window$app$__DEVELOP6.authorizeUrl,
82
- location: location,
83
- queryParams: {
84
- reason: LOGOUT_REASONS.UNAUTHORIZED,
85
- // Query parameters for OIDC-lik workflow.
86
- client_id: window.app.applicationId,
87
- response_type: OIDC_RESPONSE_TYPES.ID_TOKEN,
88
- scope: requestedScope,
89
- state: sessionId,
90
- nonce: sessionId
91
- }
92
- });
93
- }
94
- const mcOrigin = servedByProxy ? getMcOrigin(window.app.mcApiUrl) : undefined;
95
- return jsx(Redirector, {
96
- to: "login",
97
- origin: mcOrigin,
98
- location: location,
99
- queryParams: {
100
- reason: LOGOUT_REASONS.UNAUTHORIZED,
101
- redirectTo: trimLeadingAndTrailingSlashes(joinPaths(window.location.origin, location.pathname))
102
- }
103
- });
104
- };
105
- RedirectToLogin.displayName = 'RedirectToLogin';
106
-
107
- export { RedirectToLogin as default };
@@ -1,59 +0,0 @@
1
- 'use strict';
2
-
3
- var react = require('@emotion/react');
4
- var Card = require('@commercetools-uikit/card');
5
- var designSystem = require('@commercetools-uikit/design-system');
6
- var notifications = require('@commercetools-uikit/notifications');
7
- var Spacings = require('@commercetools-uikit/spacings');
8
- var Text = require('@commercetools-uikit/text');
9
- var useIsServedByProxy = require('./use-is-served-by-proxy-845cace5.cjs.prod.js');
10
- var jsxRuntime = require('@emotion/react/jsx-runtime');
11
- require('@commercetools-frontend/application-shell-connectors');
12
-
13
- function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
14
-
15
- var Card__default = /*#__PURE__*/_interopDefault(Card);
16
- var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
17
- var Text__default = /*#__PURE__*/_interopDefault(Text);
18
-
19
- const RedirectToProjectCreate = () => {
20
- const servedByProxy = useIsServedByProxy.useIsServedByProxy();
21
- /**
22
- * NOTE:
23
- * This looks a bit unusual: redirecting in render.
24
- * However, when doing it in `cDM` we loose time
25
- * we we actually do never want to render anything or
26
- * interact with anything rendered. Instead we should should
27
- * redirect away. Using a constructor would result in the same.
28
- * In turn this intends wo make explicit that we never want to
29
- * render and instead just navigate away.
30
- */
31
- if (servedByProxy === true) {
32
- useIsServedByProxy.location.replace('/account/projects/new');
33
- return null;
34
- }
35
- return jsxRuntime.jsx("div", {
36
- css: /*#__PURE__*/react.css("align-self:center;margin-top:", designSystem.customProperties.spacingXl, ";max-width:", designSystem.customProperties.constraint10, ";" + ("" ), "" ),
37
- children: jsxRuntime.jsx(Card__default["default"], {
38
- type: "flat",
39
- theme: "dark",
40
- children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
41
- children: [jsxRuntime.jsx(Text__default["default"].Headline, {
42
- as: "h1",
43
- children: "Please create a project!"
44
- }), jsxRuntime.jsx(notifications.ContentNotification, {
45
- type: "info",
46
- children: "You are running in development mode"
47
- }), jsxRuntime.jsx(Text__default["default"].Body, {
48
- children: "The Custom Application is not running behind the Merchant Center Proxy. Therefore, you are not being redirected to the account section to create a new project."
49
- }), jsxRuntime.jsx(Text__default["default"].Body, {
50
- children: "If you do need to create a project, we recommend to go to the Merchant Center production URL and create a project there. After that, you can access your new project from your local environment."
51
- })]
52
- })
53
- })
54
- });
55
- };
56
- RedirectToProjectCreate.displayName = 'RedirectToProjectCreate';
57
-
58
- exports.RedirectToProjectCreate = RedirectToProjectCreate;
59
- exports["default"] = RedirectToProjectCreate;
@@ -1,59 +0,0 @@
1
- 'use strict';
2
-
3
- var react = require('@emotion/react');
4
- var Card = require('@commercetools-uikit/card');
5
- var designSystem = require('@commercetools-uikit/design-system');
6
- var notifications = require('@commercetools-uikit/notifications');
7
- var Spacings = require('@commercetools-uikit/spacings');
8
- var Text = require('@commercetools-uikit/text');
9
- var useIsServedByProxy = require('./use-is-served-by-proxy-ed411f45.cjs.dev.js');
10
- var jsxRuntime = require('@emotion/react/jsx-runtime');
11
- require('@commercetools-frontend/application-shell-connectors');
12
-
13
- function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
14
-
15
- var Card__default = /*#__PURE__*/_interopDefault(Card);
16
- var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
17
- var Text__default = /*#__PURE__*/_interopDefault(Text);
18
-
19
- const RedirectToProjectCreate = () => {
20
- const servedByProxy = useIsServedByProxy.useIsServedByProxy();
21
- /**
22
- * NOTE:
23
- * This looks a bit unusual: redirecting in render.
24
- * However, when doing it in `cDM` we loose time
25
- * we we actually do never want to render anything or
26
- * interact with anything rendered. Instead we should should
27
- * redirect away. Using a constructor would result in the same.
28
- * In turn this intends wo make explicit that we never want to
29
- * render and instead just navigate away.
30
- */
31
- if (servedByProxy === true) {
32
- useIsServedByProxy.location.replace('/account/projects/new');
33
- return null;
34
- }
35
- return jsxRuntime.jsx("div", {
36
- css: /*#__PURE__*/react.css("align-self:center;margin-top:", designSystem.customProperties.spacingXl, ";max-width:", designSystem.customProperties.constraint10, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:RedirectToProjectCreate;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlZGlyZWN0LXRvLXByb2plY3QtY3JlYXRlLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE2QmMiLC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cbiAgICAgICAgICA8VGV4dC5Cb2R5PlxuICAgICAgICAgICAgVGhlIEN1c3RvbSBBcHBsaWNhdGlvbiBpcyBub3QgcnVubmluZyBiZWhpbmQgdGhlIE1lcmNoYW50IENlbnRlclxuICAgICAgICAgICAgUHJveHkuIFRoZXJlZm9yZSwgeW91IGFyZSBub3QgYmVpbmcgcmVkaXJlY3RlZCB0byB0aGUgYWNjb3VudFxuICAgICAgICAgICAgc2VjdGlvbiB0byBjcmVhdGUgYSBuZXcgcHJvamVjdC5cbiAgICAgICAgICA8L1RleHQuQm9keT5cbiAgICAgICAgICA8VGV4dC5Cb2R5PlxuICAgICAgICAgICAgSWYgeW91IGRvIG5lZWQgdG8gY3JlYXRlIGEgcHJvamVjdCwgd2UgcmVjb21tZW5kIHRvIGdvIHRvIHRoZVxuICAgICAgICAgICAgTWVyY2hhbnQgQ2VudGVyIHByb2R1Y3Rpb24gVVJMIGFuZCBjcmVhdGUgYSBwcm9qZWN0IHRoZXJlLiBBZnRlclxuICAgICAgICAgICAgdGhhdCwgeW91IGNhbiBhY2Nlc3MgeW91ciBuZXcgcHJvamVjdCBmcm9tIHlvdXIgbG9jYWwgZW52aXJvbm1lbnQuXG4gICAgICAgICAgPC9UZXh0LkJvZHk+XG4gICAgICAgIDwvU3BhY2luZ3MuU3RhY2s+XG4gICAgICA8L0NhcmQ+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuUmVkaXJlY3RUb1Byb2plY3RDcmVhdGUuZGlzcGxheU5hbWUgPSAnUmVkaXJlY3RUb1Byb2plY3RDcmVhdGUnO1xuXG5leHBvcnQgZGVmYXVsdCBSZWRpcmVjdFRvUHJvamVjdENyZWF0ZTtcbiJdfQ== */"),
37
- children: jsxRuntime.jsx(Card__default["default"], {
38
- type: "flat",
39
- theme: "dark",
40
- children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
41
- children: [jsxRuntime.jsx(Text__default["default"].Headline, {
42
- as: "h1",
43
- children: "Please create a project!"
44
- }), jsxRuntime.jsx(notifications.ContentNotification, {
45
- type: "info",
46
- children: "You are running in development mode"
47
- }), jsxRuntime.jsx(Text__default["default"].Body, {
48
- children: "The Custom Application is not running behind the Merchant Center Proxy. Therefore, you are not being redirected to the account section to create a new project."
49
- }), jsxRuntime.jsx(Text__default["default"].Body, {
50
- children: "If you do need to create a project, we recommend to go to the Merchant Center production URL and create a project there. After that, you can access your new project from your local environment."
51
- })]
52
- })
53
- })
54
- });
55
- };
56
- RedirectToProjectCreate.displayName = 'RedirectToProjectCreate';
57
-
58
- exports.RedirectToProjectCreate = RedirectToProjectCreate;
59
- exports["default"] = RedirectToProjectCreate;
@@ -1,50 +0,0 @@
1
- import { css } from '@emotion/react';
2
- import Card from '@commercetools-uikit/card';
3
- import { customProperties } from '@commercetools-uikit/design-system';
4
- import { ContentNotification } from '@commercetools-uikit/notifications';
5
- import Spacings from '@commercetools-uikit/spacings';
6
- import Text from '@commercetools-uikit/text';
7
- import { u as useIsServedByProxy, l as location } from './use-is-served-by-proxy-77984220.esm.js';
8
- import { jsx, jsxs } from '@emotion/react/jsx-runtime';
9
- import '@commercetools-frontend/application-shell-connectors';
10
-
11
- const RedirectToProjectCreate = () => {
12
- const servedByProxy = useIsServedByProxy();
13
- /**
14
- * NOTE:
15
- * This looks a bit unusual: redirecting in render.
16
- * However, when doing it in `cDM` we loose time
17
- * we we actually do never want to render anything or
18
- * interact with anything rendered. Instead we should should
19
- * redirect away. Using a constructor would result in the same.
20
- * In turn this intends wo make explicit that we never want to
21
- * render and instead just navigate away.
22
- */
23
- if (servedByProxy === true) {
24
- location.replace('/account/projects/new');
25
- return null;
26
- }
27
- return jsx("div", {
28
- css: /*#__PURE__*/css("align-self:center;margin-top:", customProperties.spacingXl, ";max-width:", customProperties.constraint10, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:RedirectToProjectCreate;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3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gICBZb3UgYXJlIHJ1bm5pbmcgaW4gZGV2ZWxvcG1lbnQgbW9kZVxuICAgICAgICAgIDwvQ29udGVudE5vdGlmaWNhdGlvbj5cbiAgICAgICAgICA8VGV4dC5Cb2R5PlxuICAgICAgICAgICAgVGhlIEN1c3RvbSBBcHBsaWNhdGlvbiBpcyBub3QgcnVubmluZyBiZWhpbmQgdGhlIE1lcmNoYW50IENlbnRlclxuICAgICAgICAgICAgUHJveHkuIFRoZXJlZm9yZSwgeW91IGFyZSBub3QgYmVpbmcgcmVkaXJlY3RlZCB0byB0aGUgYWNjb3VudFxuICAgICAgICAgICAgc2VjdGlvbiB0byBjcmVhdGUgYSBuZXcgcHJvamVjdC5cbiAgICAgICAgICA8L1RleHQuQm9keT5cbiAgICAgICAgICA8VGV4dC5Cb2R5PlxuICAgICAgICAgICAgSWYgeW91IGRvIG5lZWQgdG8gY3JlYXRlIGEgcHJvamVjdCwgd2UgcmVjb21tZW5kIHRvIGdvIHRvIHRoZVxuICAgICAgICAgICAgTWVyY2hhbnQgQ2VudGVyIHByb2R1Y3Rpb24gVVJMIGFuZCBjcmVhdGUgYSBwcm9qZWN0IHRoZXJlLiBBZnRlclxuICAgICAgICAgICAgdGhhdCwgeW91IGNhbiBhY2Nlc3MgeW91ciBuZXcgcHJvamVjdCBmcm9tIHlvdXIgbG9jYWwgZW52aXJvbm1lbnQuXG4gICAgICAgICAgPC9UZXh0LkJvZHk+XG4gICAgICAgIDwvU3BhY2luZ3MuU3RhY2s+XG4gICAgICA8L0NhcmQ+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuUmVkaXJlY3RUb1Byb2plY3RDcmVhdGUuZGlzcGxheU5hbWUgPSAnUmVkaXJlY3RUb1Byb2plY3RDcmVhdGUnO1xuXG5leHBvcnQgZGVmYXVsdCBSZWRpcmVjdFRvUHJvamVjdENyZWF0ZTtcbiJdfQ== */"),
29
- children: jsx(Card, {
30
- type: "flat",
31
- theme: "dark",
32
- children: jsxs(Spacings.Stack, {
33
- children: [jsx(Text.Headline, {
34
- as: "h1",
35
- children: "Please create a project!"
36
- }), jsx(ContentNotification, {
37
- type: "info",
38
- children: "You are running in development mode"
39
- }), jsx(Text.Body, {
40
- children: "The Custom Application is not running behind the Merchant Center Proxy. Therefore, you are not being redirected to the account section to create a new project."
41
- }), jsx(Text.Body, {
42
- children: "If you do need to create a project, we recommend to go to the Merchant Center production URL and create a project there. After that, you can access your new project from your local environment."
43
- })]
44
- })
45
- })
46
- });
47
- };
48
- RedirectToProjectCreate.displayName = 'RedirectToProjectCreate';
49
-
50
- export { RedirectToProjectCreate, RedirectToProjectCreate as default };