@jetbrains/ring-ui-built 7.0.65 → 7.0.70
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/components/_helpers/anchor.js +12 -17
- package/components/_helpers/avatar-info.js +4 -5
- package/components/_helpers/button.classes.js +20 -21
- package/components/_helpers/caption.js +3 -3
- package/components/_helpers/card.js +26 -32
- package/components/_helpers/dialog-body-scroll-preventer.js +1 -2
- package/components/_helpers/icon-svg.js +9 -12
- package/components/_helpers/input.js +78 -86
- package/components/_helpers/loader-core.js +260 -0
- package/components/_helpers/query-assist-suggestions.js +0 -1
- package/components/_helpers/select-filter.js +19 -26
- package/components/_helpers/services-link.js +9 -12
- package/components/_helpers/sidebar.js +36 -44
- package/components/_helpers/tab-link.js +9 -11
- package/components/_helpers/theme.js +20 -24
- package/components/_helpers/title.js +12 -17
- package/components/alert/alert.js +41 -49
- package/components/alert/container.js +9 -12
- package/components/alert-service/alert-service.js +23 -32
- package/components/analytics/analytics-custom-plugin.js +12 -17
- package/components/analytics/analytics.js +1 -3
- package/components/auth/auth-core.js +128 -170
- package/components/auth/auth.js +3 -10
- package/components/auth/background-flow.js +5 -8
- package/components/auth/down-notification.js +9 -17
- package/components/auth/iframe-flow.js +13 -19
- package/components/auth/request-builder.js +4 -9
- package/components/auth/response-parser.js +9 -12
- package/components/auth/storage.js +12 -18
- package/components/auth/token-validator.js +19 -30
- package/components/auth/window-flow.js +22 -27
- package/components/auth-dialog/auth-dialog.js +40 -48
- package/components/auth-dialog-service/auth-dialog-service.js +10 -13
- package/components/avatar/avatar.figma.js +6 -6
- package/components/avatar/avatar.js +58 -59
- package/components/avatar/fallback-avatar.js +8 -11
- package/components/avatar-stack/avatar-stack.figma.js +10 -11
- package/components/avatar-stack/avatar-stack.js +25 -31
- package/components/banner/banner.js +0 -6
- package/components/breadcrumbs/breadcrumbs.figma.js +8 -6
- package/components/breadcrumbs/breadcrumbs.js +4 -5
- package/components/button/button.figma.js +15 -10
- package/components/button/button.js +59 -64
- package/components/button-group/button-group.js +11 -15
- package/components/button-group/caption.js +0 -1
- package/components/button-set/button-set.js +9 -12
- package/components/button-toolbar/button-toolbar.js +8 -11
- package/components/caret/caret.js +20 -28
- package/components/checkbox/checkbox-group.figma.js +8 -10
- package/components/checkbox/checkbox.figma.js +5 -5
- package/components/checkbox/checkbox.js +27 -35
- package/components/clipboard/clipboard-fallback.js +3 -3
- package/components/clipboard/clipboard.js +3 -16
- package/components/code/code.js +8 -14
- package/components/collapse/collapse-content.js +10 -15
- package/components/collapse/collapse-control.js +5 -7
- package/components/collapse/collapse.js +9 -11
- package/components/collapse/utils.js +1 -1
- package/components/confirm/confirm.js +17 -26
- package/components/confirm-service/confirm-service.js +30 -31
- package/components/content-layout/content-layout.js +21 -28
- package/components/content-layout/sidebar.js +0 -2
- package/components/contenteditable/contenteditable.js +23 -28
- package/components/control-help/control-help.js +8 -10
- package/components/control-label/control-label.js +12 -17
- package/components/data-list/data-list.js +57 -65
- package/components/data-list/data-list.mock.js +0 -4
- package/components/data-list/item.js +65 -72
- package/components/data-list/selection.js +11 -19
- package/components/data-list/title.js +0 -4
- package/components/date-picker/consts.js +3 -4
- package/components/date-picker/date-input.js +25 -33
- package/components/date-picker/date-picker.js +179 -193
- package/components/date-picker/date-popup.js +135 -127
- package/components/date-picker/day.d.ts +1 -1
- package/components/date-picker/day.js +24 -30
- package/components/date-picker/month-names.js +7 -12
- package/components/date-picker/month-slider.js +16 -22
- package/components/date-picker/month.js +3 -5
- package/components/date-picker/months.js +6 -6
- package/components/date-picker/weekdays.js +0 -1
- package/components/date-picker/years.js +20 -26
- package/components/dialog/dialog-body-scroll-preventer.js +0 -1
- package/components/dialog/dialog.js +73 -83
- package/components/dropdown/anchor.js +0 -4
- package/components/dropdown/dropdown.js +98 -114
- package/components/dropdown-menu/dropdown-menu.js +80 -79
- package/components/editable-heading/editable-heading.js +48 -54
- package/components/error-bubble/error-bubble.figma.js +4 -4
- package/components/error-bubble/error-bubble.js +9 -13
- package/components/error-message/error-message.js +1 -6
- package/components/footer/footer.js +11 -15
- package/components/global/compose-refs.js +1 -4
- package/components/global/compose.js +1 -4
- package/components/global/configuration.js +3 -3
- package/components/global/controls-height.js +0 -1
- package/components/global/create-stateful-context.js +10 -14
- package/components/global/data-tests.js +2 -10
- package/components/global/dom.js +6 -19
- package/components/global/focus-sensor-hoc.js +74 -87
- package/components/global/fuzzy-highlight.js +3 -8
- package/components/global/get-uid.js +1 -1
- package/components/global/inject-styles.js +5 -6
- package/components/global/listeners.js +2 -11
- package/components/global/memoize.js +0 -2
- package/components/global/normalize-indent.js +2 -6
- package/components/global/promise-with-timeout.js +4 -5
- package/components/global/react-dom-renderer.js +4 -9
- package/components/global/rerender-hoc.js +8 -11
- package/components/global/schedule-raf.js +1 -2
- package/components/global/theme.js +0 -5
- package/components/global/trivial-template-tag.js +1 -6
- package/components/global/url.js +2 -6
- package/components/global/use-event-callback.js +2 -3
- package/components/grid/col.js +7 -18
- package/components/grid/grid.js +9 -14
- package/components/grid/row.js +7 -11
- package/components/group/group.js +9 -12
- package/components/header/header-icon.js +8 -13
- package/components/header/header.js +16 -27
- package/components/header/links.js +7 -10
- package/components/header/logo.js +12 -16
- package/components/header/profile.js +73 -83
- package/components/header/services-link.js +0 -2
- package/components/header/services.js +32 -43
- package/components/header/smart-profile.js +44 -59
- package/components/header/smart-services.js +33 -45
- package/components/header/tray.js +8 -10
- package/components/heading/heading.js +27 -27
- package/components/http/http.js +120 -125
- package/components/http/http.mock.js +6 -10
- package/components/hub-source/hub-source-user.js +6 -13
- package/components/hub-source/hub-source-users-groups.js +8 -12
- package/components/hub-source/hub-source.js +8 -10
- package/components/i18n/i18n-context.js +4 -7
- package/components/i18n/i18n.js +5 -5
- package/components/icon/icon-svg.js +0 -4
- package/components/icon/icon.js +28 -32
- package/components/icon/index.js +0 -4
- package/components/input/input.figma.js +8 -8
- package/components/input/input.js +0 -4
- package/components/island/adaptive-island-hoc.js +19 -23
- package/components/island/content.js +70 -75
- package/components/island/header.js +21 -21
- package/components/island/island.js +11 -14
- package/components/link/clickable-link.js +30 -37
- package/components/link/link.js +27 -29
- package/components/list/list-custom.js +6 -11
- package/components/list/list-item.js +49 -56
- package/components/list/list-separator.js +0 -1
- package/components/list/list-title.js +0 -1
- package/components/list/list-users-groups-source.js +14 -22
- package/components/list/list.classes.js +8 -9
- package/components/list/list.js +387 -404
- package/components/loader/loader-core.js +2 -265
- package/components/loader/loader.d.ts +8 -0
- package/components/loader/loader.js +43 -29
- package/components/loader-inline/loader-inline.js +9 -12
- package/components/loader-screen/loader-screen.js +10 -14
- package/components/login-dialog/login-dialog.js +46 -54
- package/components/login-dialog/service.js +13 -15
- package/components/message/message.js +65 -79
- package/components/old-browsers-message/old-browsers-message-stop.js +0 -3
- package/components/old-browsers-message/old-browsers-message.js +1 -4
- package/components/old-browsers-message/white-list.js +5 -7
- package/components/pager/pager.js +73 -88
- package/components/panel/panel.js +9 -12
- package/components/permissions/permissions-cache.js +6 -8
- package/components/permissions/permissions.js +19 -21
- package/components/popup/popup.js +136 -145
- package/components/popup/popup.target.js +8 -10
- package/components/popup/position-css.js +19 -27
- package/components/popup/position.js +22 -28
- package/components/popup-menu/popup-menu.js +27 -37
- package/components/progress-bar/progress-bar.js +26 -32
- package/components/query-assist/query-assist-suggestions.js +0 -6
- package/components/query-assist/query-assist.js +432 -468
- package/components/radio/radio-item.js +30 -40
- package/components/radio/radio.js +6 -10
- package/components/scrollable-section/scrollable-section.js +7 -10
- package/components/select/select-filter.js +0 -6
- package/components/select/select-popup.js +155 -174
- package/components/select/select.js +464 -479
- package/components/shortcuts/core.js +40 -45
- package/components/shortcuts/shortcut-title.js +0 -1
- package/components/shortcuts/shortcuts-hoc.js +9 -15
- package/components/shortcuts/shortcuts.js +3 -5
- package/components/slider/slider.js +53 -66
- package/components/slider/slider.utils.js +1 -4
- package/components/storage/storage-local.js +2 -8
- package/components/storage/storage.js +0 -5
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +21 -30
- package/components/table/cell.js +3 -4
- package/components/table/disable-hover-hoc.js +24 -28
- package/components/table/header-cell.js +30 -38
- package/components/table/header.js +20 -28
- package/components/table/multitable.js +81 -101
- package/components/table/row-with-focus-sensor.js +17 -28
- package/components/table/row.js +89 -99
- package/components/table/selection-adapter.js +0 -2
- package/components/table/selection-shortcuts-hoc.js +159 -161
- package/components/table/selection.js +23 -31
- package/components/table/simple-table.js +16 -22
- package/components/table/smart-table.js +19 -26
- package/components/table/table.js +137 -146
- package/components/tabs/collapsible-more.js +34 -47
- package/components/tabs/collapsible-tab.js +28 -33
- package/components/tabs/collapsible-tabs.js +18 -26
- package/components/tabs/custom-item.js +3 -6
- package/components/tabs/dumb-tabs.js +48 -64
- package/components/tabs/smart-tabs.js +14 -23
- package/components/tabs/tab-link.js +0 -2
- package/components/tabs/tab.js +0 -1
- package/components/tabs/tabs.js +0 -7
- package/components/tag/tag.js +30 -35
- package/components/tags-input/tags-input.js +192 -218
- package/components/tags-list/tags-list.js +26 -31
- package/components/text/text.js +16 -19
- package/components/toggle/toggle.js +19 -23
- package/components/tooltip/tooltip.js +110 -121
- package/components/upload/upload.js +19 -28
- package/components/user-agreement/service.js +247 -252
- package/components/user-agreement/toolbox.eula.js +160 -1
- package/components/user-agreement/user-agreement.js +23 -32
- package/components/user-card/card.js +0 -5
- package/components/user-card/smart-user-card-tooltip.js +41 -50
- package/components/user-card/tooltip.js +32 -38
- package/components/user-card/user-card.js +0 -5
- package/package.json +9 -3
- package/components/_helpers/_rollupPluginBabelHelpers.js +0 -72
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
3
|
-
import 'core-js/modules/es.string.replace.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
|
-
import 'core-js/modules/web.url.js';
|
|
6
|
-
import 'core-js/modules/web.url.to-json.js';
|
|
7
|
-
import 'core-js/modules/web.url-search-params.js';
|
|
8
1
|
import { getAbsoluteBaseURL, fixUrl } from '../global/url.js';
|
|
9
2
|
import Listeners from '../global/listeners.js';
|
|
10
3
|
import HTTP from '../http/http.js';
|
|
@@ -15,7 +8,6 @@ import AuthResponseParser from './response-parser.js';
|
|
|
15
8
|
import AuthRequestBuilder from './request-builder.js';
|
|
16
9
|
import BackgroundFlow from './background-flow.js';
|
|
17
10
|
import TokenValidator from './token-validator.js';
|
|
18
|
-
import 'core-js/modules/es.array.sort.js';
|
|
19
11
|
import '../storage/storage-local.js';
|
|
20
12
|
import '../alert-service/alert-service.js';
|
|
21
13
|
import 'react/jsx-runtime';
|
|
@@ -98,24 +90,32 @@ const DEFAULT_CONFIG = {
|
|
|
98
90
|
translations: null
|
|
99
91
|
};
|
|
100
92
|
class Auth {
|
|
93
|
+
static DEFAULT_CONFIG = DEFAULT_CONFIG;
|
|
94
|
+
static API_PATH = 'api/rest/';
|
|
95
|
+
static API_AUTH_PATH = 'oauth2/auth';
|
|
96
|
+
static API_PROFILE_PATH = 'users/me';
|
|
97
|
+
static CLOSE_BACKEND_DOWN_MESSAGE = 'backend-check-succeeded';
|
|
98
|
+
static CLOSE_WINDOW_MESSAGE = 'close-login-window';
|
|
99
|
+
static shouldRefreshToken = TokenValidator.shouldRefreshToken;
|
|
100
|
+
static storageIsUnavailable = !navigator.cookieEnabled;
|
|
101
|
+
config;
|
|
102
|
+
listeners = new Listeners();
|
|
103
|
+
http;
|
|
104
|
+
_service = {};
|
|
105
|
+
_storage;
|
|
106
|
+
_responseParser = new AuthResponseParser();
|
|
107
|
+
_requestBuilder = null;
|
|
108
|
+
_backgroundFlow;
|
|
109
|
+
_embeddedFlow = null;
|
|
110
|
+
_tokenValidator = null;
|
|
111
|
+
_postponed = false;
|
|
112
|
+
_backendCheckPromise = null;
|
|
113
|
+
_authDialogService = undefined;
|
|
114
|
+
_domainStorage;
|
|
115
|
+
user = null;
|
|
116
|
+
_initDeferred;
|
|
117
|
+
_isLoginWindowOpen;
|
|
101
118
|
constructor(config) {
|
|
102
|
-
_defineProperty(this, "config", void 0);
|
|
103
|
-
_defineProperty(this, "listeners", new Listeners());
|
|
104
|
-
_defineProperty(this, "http", void 0);
|
|
105
|
-
_defineProperty(this, "_service", {});
|
|
106
|
-
_defineProperty(this, "_storage", void 0);
|
|
107
|
-
_defineProperty(this, "_responseParser", new AuthResponseParser());
|
|
108
|
-
_defineProperty(this, "_requestBuilder", null);
|
|
109
|
-
_defineProperty(this, "_backgroundFlow", void 0);
|
|
110
|
-
_defineProperty(this, "_embeddedFlow", null);
|
|
111
|
-
_defineProperty(this, "_tokenValidator", null);
|
|
112
|
-
_defineProperty(this, "_postponed", false);
|
|
113
|
-
_defineProperty(this, "_backendCheckPromise", null);
|
|
114
|
-
_defineProperty(this, "_authDialogService", undefined);
|
|
115
|
-
_defineProperty(this, "_domainStorage", void 0);
|
|
116
|
-
_defineProperty(this, "user", null);
|
|
117
|
-
_defineProperty(this, "_initDeferred", void 0);
|
|
118
|
-
_defineProperty(this, "_isLoginWindowOpen", void 0);
|
|
119
119
|
if (!config) {
|
|
120
120
|
throw new Error('Config is required');
|
|
121
121
|
}
|
|
@@ -124,10 +124,13 @@ class Auth {
|
|
|
124
124
|
}
|
|
125
125
|
const unsupportedParams = ['redirect_uri', 'request_credentials', 'client_id'].filter(param => Object.prototype.hasOwnProperty.call(config, param));
|
|
126
126
|
if (unsupportedParams.length !== 0) {
|
|
127
|
-
throw new Error(
|
|
127
|
+
throw new Error(`The following parameters are no longer supported: ${unsupportedParams.join(', ')}. Please change them from snake_case to camelCase.`);
|
|
128
128
|
}
|
|
129
129
|
config.userFields = config.userFields || [];
|
|
130
|
-
this.config =
|
|
130
|
+
this.config = {
|
|
131
|
+
...Auth.DEFAULT_CONFIG,
|
|
132
|
+
...config
|
|
133
|
+
};
|
|
131
134
|
const {
|
|
132
135
|
clientId,
|
|
133
136
|
redirect,
|
|
@@ -148,10 +151,10 @@ class Auth {
|
|
|
148
151
|
scope.push(Auth.DEFAULT_CONFIG.clientId);
|
|
149
152
|
}
|
|
150
153
|
this._storage = new AuthStorage({
|
|
151
|
-
messagePrefix:
|
|
152
|
-
stateKeyPrefix:
|
|
153
|
-
tokenKey:
|
|
154
|
-
userKey:
|
|
154
|
+
messagePrefix: `${clientId}-message-`,
|
|
155
|
+
stateKeyPrefix: `${clientId}-states-`,
|
|
156
|
+
tokenKey: `${clientId}-token`,
|
|
157
|
+
userKey: `${clientId}-user-`
|
|
155
158
|
});
|
|
156
159
|
this._domainStorage = new AuthStorage({
|
|
157
160
|
messagePrefix: 'domain-message-'
|
|
@@ -204,20 +207,13 @@ class Auth {
|
|
|
204
207
|
}
|
|
205
208
|
});
|
|
206
209
|
if (this.config.cacheCurrentUser) {
|
|
207
|
-
this.addListener(LOGOUT_EVENT, () =>
|
|
208
|
-
|
|
209
|
-
return (_this$_storage = this._storage) === null || _this$_storage === void 0 ? void 0 : _this$_storage.wipeCachedCurrentUser();
|
|
210
|
-
});
|
|
211
|
-
this.addListener(USER_CHANGED_EVENT, () => {
|
|
212
|
-
var _this$_storage2;
|
|
213
|
-
return (_this$_storage2 = this._storage) === null || _this$_storage2 === void 0 ? void 0 : _this$_storage2.onUserChanged();
|
|
214
|
-
});
|
|
210
|
+
this.addListener(LOGOUT_EVENT, () => this._storage?.wipeCachedCurrentUser());
|
|
211
|
+
this.addListener(USER_CHANGED_EVENT, () => this._storage?.onUserChanged());
|
|
215
212
|
}
|
|
216
213
|
this._createInitDeferred();
|
|
217
214
|
this.setUpPreconnect(config.serverUri);
|
|
218
215
|
}
|
|
219
|
-
_setPostponed() {
|
|
220
|
-
let postponed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
216
|
+
_setPostponed(postponed = false) {
|
|
221
217
|
this._postponed = postponed;
|
|
222
218
|
}
|
|
223
219
|
_updateDomainUser(userID) {
|
|
@@ -252,8 +248,7 @@ class Auth {
|
|
|
252
248
|
*/
|
|
253
249
|
// eslint-disable-next-line complexity
|
|
254
250
|
async init() {
|
|
255
|
-
|
|
256
|
-
(_this$_storage3 = this._storage) === null || _this$_storage3 === void 0 || _this$_storage3.onTokenChange(async token => {
|
|
251
|
+
this._storage?.onTokenChange(async token => {
|
|
257
252
|
const isGuest = this.user ? this.user.guest : false;
|
|
258
253
|
if (isGuest && !token) {
|
|
259
254
|
return;
|
|
@@ -301,18 +296,16 @@ class Auth {
|
|
|
301
296
|
return new Promise(noop);
|
|
302
297
|
}
|
|
303
298
|
try {
|
|
304
|
-
var _this$_tokenValidator, _this$_initDeferred, _this$_initDeferred$r, _state;
|
|
305
299
|
// Check if there is a valid token
|
|
306
|
-
await
|
|
300
|
+
await this._tokenValidator?.validateToken();
|
|
307
301
|
// Checking if there is a message left by another app on this domain
|
|
308
|
-
const message = await this._domainStorage._messagesStorage.get(
|
|
302
|
+
const message = await this._domainStorage._messagesStorage.get(`domain-message-${DOMAIN_USER_CHANGED_EVENT}`);
|
|
309
303
|
if (message) {
|
|
310
|
-
var _this$user;
|
|
311
304
|
const {
|
|
312
305
|
userID,
|
|
313
306
|
serviceID
|
|
314
307
|
} = message;
|
|
315
|
-
if (serviceID !== this.config.clientId && (!userID ||
|
|
308
|
+
if (serviceID !== this.config.clientId && (!userID || this.user?.id !== userID)) {
|
|
316
309
|
this.forceTokenUpdate();
|
|
317
310
|
}
|
|
318
311
|
}
|
|
@@ -322,12 +315,11 @@ class Auth {
|
|
|
322
315
|
// Check if we have requested to restore state anyway
|
|
323
316
|
state = await this._checkForStateRestoration();
|
|
324
317
|
}
|
|
325
|
-
|
|
326
|
-
return
|
|
318
|
+
this._initDeferred?.resolve?.(state && state.restoreLocation);
|
|
319
|
+
return state?.restoreLocation;
|
|
327
320
|
} catch (error) {
|
|
328
321
|
if (Auth.storageIsUnavailable) {
|
|
329
|
-
|
|
330
|
-
(_this$_initDeferred2 = this._initDeferred) === null || _this$_initDeferred2 === void 0 || (_this$_initDeferred2$ = _this$_initDeferred2.resolve) === null || _this$_initDeferred2$ === void 0 || _this$_initDeferred2$.call(_this$_initDeferred2); // No way to handle if cookies are disabled
|
|
322
|
+
this._initDeferred?.resolve?.(); // No way to handle if cookies are disabled
|
|
331
323
|
await this.requestUser(); // Someone may expect user to be loaded as a part of token validation
|
|
332
324
|
return null;
|
|
333
325
|
}
|
|
@@ -335,8 +327,7 @@ class Auth {
|
|
|
335
327
|
}
|
|
336
328
|
}
|
|
337
329
|
async sendRedirect(error) {
|
|
338
|
-
|
|
339
|
-
const authRequest = await ((_this$_requestBuilder = this._requestBuilder) === null || _this$_requestBuilder === void 0 ? void 0 : _this$_requestBuilder.prepareAuthRequest());
|
|
330
|
+
const authRequest = await this._requestBuilder?.prepareAuthRequest();
|
|
340
331
|
if (authRequest) {
|
|
341
332
|
this._redirectCurrentPage(authRequest.url);
|
|
342
333
|
}
|
|
@@ -349,12 +340,10 @@ class Auth {
|
|
|
349
340
|
async handleInitError(error) {
|
|
350
341
|
if ('stateId' in error && error.stateId) {
|
|
351
342
|
try {
|
|
352
|
-
|
|
353
|
-
const state = await ((_this$_storage4 = this._storage) === null || _this$_storage4 === void 0 ? void 0 : _this$_storage4.getState(error.stateId));
|
|
343
|
+
const state = await this._storage?.getState(error.stateId);
|
|
354
344
|
if (state && state.nonRedirect) {
|
|
355
|
-
var _this$_storage5;
|
|
356
345
|
state.error = error;
|
|
357
|
-
|
|
346
|
+
this._storage?.saveState(error.stateId, state);
|
|
358
347
|
// Return endless promise in the background to avoid service start
|
|
359
348
|
return new Promise(noop);
|
|
360
349
|
}
|
|
@@ -365,8 +354,7 @@ class Auth {
|
|
|
365
354
|
throw error;
|
|
366
355
|
}
|
|
367
356
|
async handleInitValidationError(error) {
|
|
368
|
-
|
|
369
|
-
if ('cause' in error && error.cause instanceof Error && ((_error$cause = error.cause) === null || _error$cause === void 0 ? void 0 : _error$cause.message) === 'invalid_client') {
|
|
357
|
+
if ('cause' in error && error.cause instanceof Error && error.cause?.message === 'invalid_client') {
|
|
370
358
|
// eslint-disable-next-line no-console
|
|
371
359
|
console.error('RingUI Auth: invalid client detected. Logging out', error);
|
|
372
360
|
await this.logout();
|
|
@@ -379,17 +367,16 @@ class Auth {
|
|
|
379
367
|
// Background flow
|
|
380
368
|
if ('authRedirect' in error && error.authRedirect && !this.config.redirect) {
|
|
381
369
|
try {
|
|
382
|
-
|
|
383
|
-
await
|
|
384
|
-
|
|
385
|
-
(_this$_initDeferred3 = this._initDeferred) === null || _this$_initDeferred3 === void 0 || (_this$_initDeferred3$ = _this$_initDeferred3.resolve) === null || _this$_initDeferred3$ === void 0 || _this$_initDeferred3$.call(_this$_initDeferred3);
|
|
370
|
+
await this._backgroundFlow?.authorize();
|
|
371
|
+
await this._tokenValidator?.validateToken();
|
|
372
|
+
this._initDeferred?.resolve?.();
|
|
386
373
|
return undefined;
|
|
387
374
|
} catch (validationError) {
|
|
388
375
|
// Fallback to redirect flow
|
|
389
376
|
return validationError instanceof Error ? this.sendRedirect(validationError) : undefined;
|
|
390
377
|
}
|
|
391
378
|
}
|
|
392
|
-
|
|
379
|
+
this._initDeferred?.reject?.(error);
|
|
393
380
|
throw error;
|
|
394
381
|
}
|
|
395
382
|
/**
|
|
@@ -402,12 +389,12 @@ class Auth {
|
|
|
402
389
|
throw new Error('You should log in to be able to make requests');
|
|
403
390
|
}
|
|
404
391
|
try {
|
|
405
|
-
var
|
|
406
|
-
await
|
|
392
|
+
var _await$this$_tokenVal;
|
|
393
|
+
await this._initDeferred?.promise;
|
|
407
394
|
if (Auth.storageIsUnavailable) {
|
|
408
395
|
return null; // Forever guest if storage is unavailable
|
|
409
396
|
}
|
|
410
|
-
return (_await$this$_tokenVal = await
|
|
397
|
+
return (_await$this$_tokenVal = await this._tokenValidator?.validateTokenLocally()) !== null && _await$this$_tokenVal !== void 0 ? _await$this$_tokenVal : null;
|
|
411
398
|
} catch (e) {
|
|
412
399
|
return this.forceTokenUpdate();
|
|
413
400
|
}
|
|
@@ -428,10 +415,9 @@ class Auth {
|
|
|
428
415
|
this._backendCheckPromise = null;
|
|
429
416
|
}
|
|
430
417
|
try {
|
|
431
|
-
var _await$this$_backgrou
|
|
432
|
-
return (_await$this$_backgrou = await
|
|
418
|
+
var _await$this$_backgrou;
|
|
419
|
+
return (_await$this$_backgrou = await this._backgroundFlow?.authorize()) !== null && _await$this$_backgrou !== void 0 ? _await$this$_backgrou : null;
|
|
433
420
|
} catch (error) {
|
|
434
|
-
var _this$_requestBuilder2;
|
|
435
421
|
if (!(error instanceof Error)) {
|
|
436
422
|
return null;
|
|
437
423
|
}
|
|
@@ -439,8 +425,7 @@ class Auth {
|
|
|
439
425
|
return new Promise(resolve => {
|
|
440
426
|
const onTryAgain = async () => {
|
|
441
427
|
try {
|
|
442
|
-
|
|
443
|
-
const result = await ((_this$_backgroundFlow3 = this._backgroundFlow) === null || _this$_backgroundFlow3 === void 0 ? void 0 : _this$_backgroundFlow3.authorize());
|
|
428
|
+
const result = await this._backgroundFlow?.authorize();
|
|
444
429
|
resolve(result !== null && result !== void 0 ? result : null);
|
|
445
430
|
} catch (retryError) {
|
|
446
431
|
if (retryError instanceof Error) {
|
|
@@ -460,7 +445,7 @@ class Auth {
|
|
|
460
445
|
});
|
|
461
446
|
});
|
|
462
447
|
}
|
|
463
|
-
const authRequest = await
|
|
448
|
+
const authRequest = await this._requestBuilder?.prepareAuthRequest();
|
|
464
449
|
if (authRequest) {
|
|
465
450
|
this._redirectCurrentPage(authRequest.url);
|
|
466
451
|
}
|
|
@@ -475,7 +460,7 @@ class Auth {
|
|
|
475
460
|
const {
|
|
476
461
|
serviceName,
|
|
477
462
|
iconUrl: serviceImage
|
|
478
|
-
} = (await this.http.get(
|
|
463
|
+
} = (await this.http.get(`oauth2/interactive/login/settings?client_id=${this.config.clientId}`)) || {};
|
|
479
464
|
this.setCurrentService({
|
|
480
465
|
serviceImage,
|
|
481
466
|
serviceName
|
|
@@ -492,8 +477,7 @@ class Auth {
|
|
|
492
477
|
*/
|
|
493
478
|
getUser(accessToken) {
|
|
494
479
|
if (this.config.cacheCurrentUser) {
|
|
495
|
-
|
|
496
|
-
return (_this$_storage6 = this._storage) === null || _this$_storage6 === void 0 ? void 0 : _this$_storage6.getCachedUser(() => this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams));
|
|
480
|
+
return this._storage?.getCachedUser(() => this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams));
|
|
497
481
|
}
|
|
498
482
|
return this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams);
|
|
499
483
|
}
|
|
@@ -514,10 +498,9 @@ class Auth {
|
|
|
514
498
|
return user;
|
|
515
499
|
}
|
|
516
500
|
async updateUser() {
|
|
517
|
-
var _this$_storage7;
|
|
518
501
|
this._setPostponed(false);
|
|
519
502
|
const accessToken = await this.requestToken();
|
|
520
|
-
|
|
503
|
+
this._storage?.wipeCachedCurrentUser();
|
|
521
504
|
const user = await this.getUser(accessToken);
|
|
522
505
|
this.user = user;
|
|
523
506
|
this.listeners.trigger(USER_CHANGED_EVENT, user);
|
|
@@ -557,27 +540,25 @@ class Auth {
|
|
|
557
540
|
}
|
|
558
541
|
this.logout();
|
|
559
542
|
}
|
|
560
|
-
_showAuthDialog(
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
onTryAgain
|
|
567
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
543
|
+
_showAuthDialog({
|
|
544
|
+
nonInteractive,
|
|
545
|
+
error,
|
|
546
|
+
canCancel,
|
|
547
|
+
onTryAgain
|
|
548
|
+
} = {}) {
|
|
568
549
|
const {
|
|
569
550
|
embeddedLogin,
|
|
570
551
|
onPostponeLogout,
|
|
571
552
|
translations
|
|
572
553
|
} = this.config;
|
|
573
|
-
const cancelable =
|
|
554
|
+
const cancelable = this.user?.guest || canCancel;
|
|
574
555
|
const actualTranslations = translations !== null && translations !== void 0 ? translations : getTranslations();
|
|
575
556
|
this._createInitDeferred();
|
|
576
557
|
const closeDialog = () => {
|
|
577
558
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
578
|
-
stopTokenListening
|
|
579
|
-
stopMessageListening
|
|
580
|
-
hide
|
|
559
|
+
stopTokenListening?.();
|
|
560
|
+
stopMessageListening?.();
|
|
561
|
+
hide?.();
|
|
581
562
|
/* eslint-enable @typescript-eslint/no-use-before-define */
|
|
582
563
|
};
|
|
583
564
|
const onConfirm = () => {
|
|
@@ -589,29 +570,27 @@ class Auth {
|
|
|
589
570
|
this._runEmbeddedLogin();
|
|
590
571
|
};
|
|
591
572
|
const onCancel = () => {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
(_this$_storage8 = this._storage) === null || _this$_storage8 === void 0 || _this$_storage8.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
|
|
573
|
+
this._embeddedFlow?.stop();
|
|
574
|
+
this._storage?.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
|
|
595
575
|
closeDialog();
|
|
596
576
|
if (!cancelable) {
|
|
597
|
-
|
|
598
|
-
(_this$_initDeferred6 = this._initDeferred) === null || _this$_initDeferred6 === void 0 || (_this$_initDeferred6$ = _this$_initDeferred6.resolve) === null || _this$_initDeferred6$ === void 0 || _this$_initDeferred6$.call(_this$_initDeferred6);
|
|
577
|
+
this._initDeferred?.resolve?.();
|
|
599
578
|
this.listeners.trigger(LOGOUT_POSTPONED_EVENT);
|
|
600
579
|
onPostponeLogout();
|
|
601
580
|
return;
|
|
602
581
|
}
|
|
603
|
-
if (
|
|
582
|
+
if (this.user?.guest && nonInteractive) {
|
|
604
583
|
this.forceTokenUpdate();
|
|
605
584
|
} else {
|
|
606
|
-
|
|
607
|
-
(_this$_initDeferred7 = this._initDeferred) === null || _this$_initDeferred7 === void 0 || (_this$_initDeferred7$ = _this$_initDeferred7.resolve) === null || _this$_initDeferred7$ === void 0 || _this$_initDeferred7$.call(_this$_initDeferred7);
|
|
585
|
+
this._initDeferred?.resolve?.();
|
|
608
586
|
}
|
|
609
587
|
};
|
|
610
588
|
const onTryAgainClick = async () => {
|
|
611
|
-
await
|
|
589
|
+
await onTryAgain?.();
|
|
612
590
|
closeDialog();
|
|
613
591
|
};
|
|
614
|
-
const hide =
|
|
592
|
+
const hide = this._authDialogService?.({
|
|
593
|
+
...this._service,
|
|
615
594
|
loginCaption: actualTranslations.login,
|
|
616
595
|
loginToCaption: actualTranslations.loginTo,
|
|
617
596
|
confirmLabel: actualTranslations.login,
|
|
@@ -621,43 +600,38 @@ class Auth {
|
|
|
621
600
|
onConfirm,
|
|
622
601
|
onCancel,
|
|
623
602
|
onTryAgain: onTryAgain ? onTryAgainClick : undefined
|
|
624
|
-
})
|
|
625
|
-
const stopTokenListening =
|
|
603
|
+
});
|
|
604
|
+
const stopTokenListening = this._storage?.onTokenChange(token => {
|
|
626
605
|
if (token) {
|
|
627
|
-
var _this$_initDeferred8, _this$_initDeferred8$;
|
|
628
606
|
closeDialog();
|
|
629
|
-
|
|
607
|
+
this._initDeferred?.resolve?.();
|
|
630
608
|
}
|
|
631
609
|
});
|
|
632
|
-
const stopMessageListening =
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
newUser,
|
|
641
|
-
onApply,
|
|
642
|
-
onPostpone
|
|
643
|
-
} = _ref;
|
|
610
|
+
const stopMessageListening = this._storage?.onMessage(Auth.CLOSE_WINDOW_MESSAGE, () => this._embeddedFlow?.stop());
|
|
611
|
+
}
|
|
612
|
+
_showUserChangedDialog({
|
|
613
|
+
newUser,
|
|
614
|
+
onApply,
|
|
615
|
+
onPostpone
|
|
616
|
+
}) {
|
|
617
|
+
var _translations$youHave, _newUser$name, _newUser$name2, _translations$login, _translations$loginTo, _translations$applyCh, _translations$tryAgai, _translations$postpon;
|
|
644
618
|
const {
|
|
645
619
|
translations
|
|
646
620
|
} = this.config;
|
|
647
621
|
this._createInitDeferred();
|
|
648
622
|
const done = () => {
|
|
649
|
-
|
|
650
|
-
(_this$_initDeferred9 = this._initDeferred) === null || _this$_initDeferred9 === void 0 || (_this$_initDeferred9$ = _this$_initDeferred9.resolve) === null || _this$_initDeferred9$ === void 0 || _this$_initDeferred9$.call(_this$_initDeferred9);
|
|
623
|
+
this._initDeferred?.resolve?.();
|
|
651
624
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
652
|
-
hide
|
|
625
|
+
hide?.();
|
|
653
626
|
};
|
|
654
|
-
const hide =
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
627
|
+
const hide = this._authDialogService?.({
|
|
628
|
+
...this._service,
|
|
629
|
+
title: (_translations$youHave = translations?.youHaveLoggedInAs) !== null && _translations$youHave !== void 0 ? _translations$youHave : translate('youHaveLoggedInAs').replace('%userName%', (_newUser$name = newUser.name) !== null && _newUser$name !== void 0 ? _newUser$name : '').replace('{{userName}}', (_newUser$name2 = newUser.name) !== null && _newUser$name2 !== void 0 ? _newUser$name2 : ''),
|
|
630
|
+
loginCaption: (_translations$login = translations?.login) !== null && _translations$login !== void 0 ? _translations$login : translate('login'),
|
|
631
|
+
loginToCaption: (_translations$loginTo = translations?.loginTo) !== null && _translations$loginTo !== void 0 ? _translations$loginTo : translate('loginTo'),
|
|
632
|
+
confirmLabel: (_translations$applyCh = translations?.applyChange) !== null && _translations$applyCh !== void 0 ? _translations$applyCh : translate('applyChange'),
|
|
633
|
+
tryAgainLabel: (_translations$tryAgai = translations?.tryAgainLabel) !== null && _translations$tryAgai !== void 0 ? _translations$tryAgai : translate('tryAgainLabel'),
|
|
634
|
+
cancelLabel: (_translations$postpon = translations?.postpone) !== null && _translations$postpon !== void 0 ? _translations$postpon : translate('postpone'),
|
|
661
635
|
onConfirm: () => {
|
|
662
636
|
done();
|
|
663
637
|
onApply();
|
|
@@ -666,10 +640,9 @@ class Auth {
|
|
|
666
640
|
done();
|
|
667
641
|
onPostpone();
|
|
668
642
|
}
|
|
669
|
-
})
|
|
643
|
+
});
|
|
670
644
|
}
|
|
671
|
-
_extractErrorMessage(error) {
|
|
672
|
-
let logError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
645
|
+
_extractErrorMessage(error, logError = false) {
|
|
673
646
|
if (!error) {
|
|
674
647
|
return null;
|
|
675
648
|
}
|
|
@@ -682,9 +655,9 @@ class Auth {
|
|
|
682
655
|
// https://www.jetbrains.com/help/youtrack/devportal/OAuth-2.0-Errors.html
|
|
683
656
|
if ('code' in error && error.code && typeof error.code === 'object' && 'code' in error.code && typeof error.code.code === 'string') {
|
|
684
657
|
const readableCode = error.code.code.split('_').join(' ');
|
|
685
|
-
return
|
|
658
|
+
return `Authorization error: ${readableCode}`;
|
|
686
659
|
}
|
|
687
|
-
} catch
|
|
660
|
+
} catch {
|
|
688
661
|
// noop
|
|
689
662
|
}
|
|
690
663
|
return error.toString ? error.toString() : null;
|
|
@@ -697,19 +670,17 @@ class Auth {
|
|
|
697
670
|
const REPEAT_TIMEOUT = 5000;
|
|
698
671
|
let timerId;
|
|
699
672
|
return new Promise((resolve, reject) => {
|
|
700
|
-
var _this$_storage10;
|
|
701
673
|
const done = () => {
|
|
702
|
-
var _this$_storage1;
|
|
703
674
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
704
675
|
hide();
|
|
705
676
|
window.removeEventListener('online', onCheckAgain);
|
|
706
|
-
stopListeningCloseMessage
|
|
677
|
+
stopListeningCloseMessage?.();
|
|
707
678
|
/* eslint-enable @typescript-eslint/no-use-before-define */
|
|
708
|
-
|
|
679
|
+
this._storage?.sendMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, Date.now());
|
|
709
680
|
clearTimeout(timerId);
|
|
710
681
|
};
|
|
711
|
-
const stopListeningCloseMessage =
|
|
712
|
-
stopListeningCloseMessage
|
|
682
|
+
const stopListeningCloseMessage = this._storage?.onMessage(Auth.CLOSE_BACKEND_DOWN_MESSAGE, () => {
|
|
683
|
+
stopListeningCloseMessage?.();
|
|
713
684
|
done();
|
|
714
685
|
resolve();
|
|
715
686
|
});
|
|
@@ -742,26 +713,24 @@ class Auth {
|
|
|
742
713
|
* Wipe accessToken and redirect to auth page with required authorization
|
|
743
714
|
*/
|
|
744
715
|
async logout(extraParams) {
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
}
|
|
716
|
+
const requestParams = {
|
|
717
|
+
request_credentials: 'required',
|
|
718
|
+
...extraParams
|
|
719
|
+
};
|
|
749
720
|
await this._checkBackendsStatusesIfEnabled();
|
|
750
721
|
await this.listeners.trigger('logout');
|
|
751
722
|
this._updateDomainUser(null);
|
|
752
|
-
await
|
|
753
|
-
const authRequest = await
|
|
723
|
+
await this._storage?.wipeToken();
|
|
724
|
+
const authRequest = await this._requestBuilder?.prepareAuthRequest(requestParams);
|
|
754
725
|
if (authRequest) {
|
|
755
726
|
this._redirectCurrentPage(authRequest.url);
|
|
756
727
|
}
|
|
757
728
|
}
|
|
758
729
|
async _runEmbeddedLogin() {
|
|
759
|
-
|
|
760
|
-
(_this$_storage12 = this._storage) === null || _this$_storage12 === void 0 || _this$_storage12.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
|
|
730
|
+
this._storage?.sendMessage(Auth.CLOSE_WINDOW_MESSAGE, Date.now());
|
|
761
731
|
try {
|
|
762
|
-
var _this$_embeddedFlow3;
|
|
763
732
|
this._isLoginWindowOpen = true;
|
|
764
|
-
return await
|
|
733
|
+
return await this._embeddedFlow?.authorize();
|
|
765
734
|
} finally {
|
|
766
735
|
this._isLoginWindowOpen = false;
|
|
767
736
|
}
|
|
@@ -777,8 +746,7 @@ class Auth {
|
|
|
777
746
|
}
|
|
778
747
|
await this._checkBackendsStatusesIfEnabled();
|
|
779
748
|
try {
|
|
780
|
-
|
|
781
|
-
const accessToken = await ((_this$_backgroundFlow4 = this._backgroundFlow) === null || _this$_backgroundFlow4 === void 0 ? void 0 : _this$_backgroundFlow4.authorize());
|
|
749
|
+
const accessToken = await this._backgroundFlow?.authorize();
|
|
782
750
|
const user = await this.getUser(accessToken);
|
|
783
751
|
if (user.guest) {
|
|
784
752
|
this._beforeLogout();
|
|
@@ -809,11 +777,11 @@ class Auth {
|
|
|
809
777
|
let urlFromState = null;
|
|
810
778
|
try {
|
|
811
779
|
urlFromState = new URL(state); // checking if state contains valid URL on same origin, see HUB-11514
|
|
812
|
-
} catch
|
|
780
|
+
} catch {
|
|
813
781
|
return null;
|
|
814
782
|
}
|
|
815
783
|
if (urlFromState.origin !== window.location.origin) {
|
|
816
|
-
throw new Error(
|
|
784
|
+
throw new Error(`State contains URL with different origin: "${state}"`);
|
|
817
785
|
}
|
|
818
786
|
return {
|
|
819
787
|
restoreLocation: state,
|
|
@@ -857,30 +825,28 @@ class Auth {
|
|
|
857
825
|
}
|
|
858
826
|
}
|
|
859
827
|
if (!newState) {
|
|
860
|
-
throw new Error(
|
|
828
|
+
throw new Error(`Could not create state where stateId="${stateId}"`);
|
|
861
829
|
}
|
|
862
830
|
const scopes = scope ? scope.split(' ') : newState.scopes || defaultScope || [];
|
|
863
831
|
const effectiveExpiresIn = expiresIn ? parseInt(expiresIn, 10) : defaultExpiresIn;
|
|
864
832
|
const expires = TokenValidator._epoch() + effectiveExpiresIn;
|
|
865
|
-
if (accessToken) {
|
|
866
|
-
|
|
867
|
-
await ((_this$_storage13 = this._storage) === null || _this$_storage13 === void 0 ? void 0 : _this$_storage13.saveToken({
|
|
833
|
+
if (accessToken !== undefined) {
|
|
834
|
+
await this._storage?.saveToken({
|
|
868
835
|
accessToken,
|
|
869
836
|
scopes,
|
|
870
837
|
expires,
|
|
871
838
|
lifeTime: effectiveExpiresIn
|
|
872
|
-
})
|
|
839
|
+
});
|
|
873
840
|
}
|
|
874
841
|
return newState;
|
|
875
842
|
}
|
|
876
843
|
async _checkForStateRestoration() {
|
|
877
|
-
var _this$_storage14;
|
|
878
844
|
const authResponse = this._responseParser._authResponse;
|
|
879
845
|
if (authResponse && this.config.cleanHash) {
|
|
880
846
|
this.setHash('');
|
|
881
847
|
}
|
|
882
|
-
const stateId = authResponse
|
|
883
|
-
return (await (stateId &&
|
|
848
|
+
const stateId = authResponse?.restoreAuthState;
|
|
849
|
+
return (await (stateId && this._storage?.getState(stateId))) || {};
|
|
884
850
|
}
|
|
885
851
|
_checkBackendsAreUp() {
|
|
886
852
|
const abortCtrl = new AbortController();
|
|
@@ -954,20 +920,12 @@ class Auth {
|
|
|
954
920
|
// NB! URL to redirect is formed manually because baseURI could be messed up,
|
|
955
921
|
// in which case it's not obvious where redirect will lead.
|
|
956
922
|
const cleanedUrl = [window.location.pathname, window.location.search].join('');
|
|
957
|
-
const hashIfExist = hash ?
|
|
958
|
-
history.replaceState(undefined, '',
|
|
923
|
+
const hashIfExist = hash ? `#${hash}` : '';
|
|
924
|
+
history.replaceState(undefined, '', `${cleanedUrl}${hashIfExist}`);
|
|
959
925
|
} else {
|
|
960
926
|
window.location.hash = hash;
|
|
961
927
|
}
|
|
962
928
|
}
|
|
963
929
|
}
|
|
964
|
-
_defineProperty(Auth, "DEFAULT_CONFIG", DEFAULT_CONFIG);
|
|
965
|
-
_defineProperty(Auth, "API_PATH", 'api/rest/');
|
|
966
|
-
_defineProperty(Auth, "API_AUTH_PATH", 'oauth2/auth');
|
|
967
|
-
_defineProperty(Auth, "API_PROFILE_PATH", 'users/me');
|
|
968
|
-
_defineProperty(Auth, "CLOSE_BACKEND_DOWN_MESSAGE", 'backend-check-succeeded');
|
|
969
|
-
_defineProperty(Auth, "CLOSE_WINDOW_MESSAGE", 'close-login-window');
|
|
970
|
-
_defineProperty(Auth, "shouldRefreshToken", TokenValidator.shouldRefreshToken);
|
|
971
|
-
_defineProperty(Auth, "storageIsUnavailable", !navigator.cookieEnabled);
|
|
972
930
|
|
|
973
931
|
export { Auth, DEFAULT_BACKGROUND_TIMEOUT, DEFAULT_EXPIRES_TIMEOUT, DOMAIN_USER_CHANGED_EVENT, LOGOUT_EVENT, LOGOUT_POSTPONED_EVENT, USER_CHANGED_EVENT, USER_CHANGE_POSTPONED_EVENT, Auth as default };
|
package/components/auth/auth.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import WindowFlow from './window-flow.js';
|
|
3
2
|
import onBackendDown from './down-notification.js';
|
|
4
3
|
import Auth from './auth-core.js';
|
|
5
4
|
export { DEFAULT_BACKGROUND_TIMEOUT, DEFAULT_EXPIRES_TIMEOUT, DOMAIN_USER_CHANGED_EVENT, LOGOUT_EVENT, LOGOUT_POSTPONED_EVENT, USER_CHANGED_EVENT, USER_CHANGE_POSTPONED_EVENT } from './auth-core.js';
|
|
6
5
|
import './response-parser.js';
|
|
7
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
8
|
-
import 'core-js/modules/es.string.replace.js';
|
|
9
6
|
import '../global/url.js';
|
|
10
7
|
import 'react/jsx-runtime';
|
|
11
8
|
import '../alert-service/alert-service.js';
|
|
12
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
13
9
|
import 'react-dom/client';
|
|
14
10
|
import '../global/get-uid.js';
|
|
15
11
|
import '../alert/alert.js';
|
|
@@ -46,16 +42,12 @@ import '../global/sniffer.js';
|
|
|
46
42
|
import 'sniffr';
|
|
47
43
|
import '../tab-trap/tab-trap.js';
|
|
48
44
|
import '../popup/position.js';
|
|
49
|
-
import 'core-js/modules/es.array.sort.js';
|
|
50
45
|
import '../popup/popup.consts.js';
|
|
51
46
|
import '../popup/position-css.js';
|
|
52
47
|
import '../alert/container.js';
|
|
53
48
|
import '../link/link.js';
|
|
54
49
|
import '../_helpers/link.js';
|
|
55
50
|
import '../group/group.js';
|
|
56
|
-
import 'core-js/modules/web.url.js';
|
|
57
|
-
import 'core-js/modules/web.url.to-json.js';
|
|
58
|
-
import 'core-js/modules/web.url-search-params.js';
|
|
59
51
|
import '../global/listeners.js';
|
|
60
52
|
import '../http/http.js';
|
|
61
53
|
import '../global/promise-with-timeout.js';
|
|
@@ -99,9 +91,10 @@ import './token-validator.js';
|
|
|
99
91
|
/**
|
|
100
92
|
* Extend Auth config with non-required and not pure-JS stuff
|
|
101
93
|
*/
|
|
102
|
-
Auth.DEFAULT_CONFIG =
|
|
94
|
+
Auth.DEFAULT_CONFIG = {
|
|
95
|
+
...Auth.DEFAULT_CONFIG,
|
|
103
96
|
EmbeddedLoginFlow: WindowFlow,
|
|
104
97
|
onBackendDown: onBackendDown
|
|
105
|
-
}
|
|
98
|
+
};
|
|
106
99
|
|
|
107
100
|
export { Auth, Auth as default };
|