auth0-lock 11.34.1 → 12.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +1 -0
- package/.circleci/config.yml +4 -2
- package/.eslintrc.json +5 -5
- package/.github/workflows/codeql.yml +41 -0
- package/.shiprc +4 -5
- package/CHANGELOG.md +32 -0
- package/EXAMPLES.md +626 -0
- package/README.md +77 -649
- package/karma.conf.js +1 -1
- package/lib/CSSCore.js +1 -4
- package/lib/__tests__/auth_button.js +12 -22
- package/lib/__tests__/connection/database/actions.js +48 -49
- package/lib/__tests__/connection/database/index.js +22 -28
- package/lib/__tests__/connection/database/login_pane.js +20 -41
- package/lib/__tests__/connection/database/password_reset_confirmation.js +19 -26
- package/lib/__tests__/connection/database/reset_password.js +17 -39
- package/lib/__tests__/connection/database/signed_up_confirmation.js +19 -26
- package/lib/__tests__/connection/enterprise/actions.js +22 -47
- package/lib/__tests__/connection/enterprise/hrd_pane.js +16 -33
- package/lib/__tests__/connection/enterprise/hrd_screen.js +26 -40
- package/lib/__tests__/connection/enterprise/quick_auth_screen.js +27 -68
- package/lib/__tests__/connection/passwordless/ask_vcode.js +29 -51
- package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +19 -26
- package/lib/__tests__/connection/passwordless/passwordless.js +35 -97
- package/lib/__tests__/core/actions.js +23 -46
- package/lib/__tests__/core/client/index.js +10 -13
- package/lib/__tests__/core/index.js +46 -94
- package/lib/__tests__/core/remote_data.js +14 -20
- package/lib/__tests__/core/signed_in_confirmation.js +19 -26
- package/lib/__tests__/core/sso/last_login_screen.js +27 -50
- package/lib/__tests__/core/tenant.js +10 -12
- package/lib/__tests__/core/web_api/helper.js +6 -14
- package/lib/__tests__/core/web_api/p2_api.js +38 -33
- package/lib/__tests__/core/web_api.js +37 -33
- package/lib/__tests__/engine/classic/login.js +20 -41
- package/lib/__tests__/engine/classic/mfa_login_screen.js +6 -19
- package/lib/__tests__/engine/classic/sign_up_pane.js +33 -55
- package/lib/__tests__/engine/classic/sign_up_screen.js +18 -45
- package/lib/__tests__/engine/classic.js +13 -6
- package/lib/__tests__/engine/passwordless.js +2 -5
- package/lib/__tests__/field/captcha/recaptcha_enterprise.js +27 -27
- package/lib/__tests__/field/captcha/recaptchav2.js +27 -27
- package/lib/__tests__/field/captcha.js +39 -51
- package/lib/__tests__/field/custom_input.js +23 -47
- package/lib/__tests__/field/email.js +2 -3
- package/lib/__tests__/field/email_pane.js +25 -48
- package/lib/__tests__/field/field.js +9 -13
- package/lib/__tests__/field/login_pane.js +30 -34
- package/lib/__tests__/field/mfa_code_pane.js +13 -28
- package/lib/__tests__/field/option_selection_pane.js +7 -25
- package/lib/__tests__/field/password.js +6 -12
- package/lib/__tests__/field/password_pane.js +29 -46
- package/lib/__tests__/field/phone_number_pane.js +18 -41
- package/lib/__tests__/field/social_buttons_pane.js +30 -47
- package/lib/__tests__/field/username.js +27 -48
- package/lib/__tests__/field/username_pane.js +30 -47
- package/lib/__tests__/field/vcode.js +5 -13
- package/lib/__tests__/field/vcode_pane.js +20 -44
- package/lib/__tests__/i18n.js +28 -53
- package/lib/__tests__/quick-auth/actions.js +4 -27
- package/lib/__tests__/setup-tests.js +7 -9
- package/lib/__tests__/testUtils.js +41 -58
- package/lib/__tests__/ui/box/chrome.js +24 -49
- package/lib/__tests__/ui/box/confirmation_pane.js +19 -36
- package/lib/__tests__/ui/box/container.js +21 -46
- package/lib/__tests__/ui/box/global_message.js +60 -37
- package/lib/__tests__/ui/input/email_input.js +6 -17
- package/lib/__tests__/ui/input/input_wrap.js +6 -19
- package/lib/__tests__/ui/input/password/password_strength.js +13 -15
- package/lib/__tests__/ui/input/password_input.js +22 -27
- package/lib/__tests__/utils/format.js +10 -17
- package/lib/__tests__/utils/url_utils.js +2 -5
- package/lib/avatar/gravatar_provider.js +13 -28
- package/lib/avatar.js +22 -41
- package/lib/browser.js +372 -23
- package/lib/connection/captcha.js +14 -32
- package/lib/connection/database/actions.js +39 -108
- package/lib/connection/database/index.js +90 -191
- package/lib/connection/database/login_pane.js +107 -147
- package/lib/connection/database/login_sign_up_tabs.js +106 -125
- package/lib/connection/database/mfa_pane.js +50 -69
- package/lib/connection/database/password_reset_confirmation.js +51 -73
- package/lib/connection/database/reset_password.js +116 -132
- package/lib/connection/database/reset_password_pane.js +45 -56
- package/lib/connection/database/sign_up_terms.js +17 -23
- package/lib/connection/database/signed_up_confirmation.js +52 -75
- package/lib/connection/enterprise/actions.js +23 -52
- package/lib/connection/enterprise/hrd_pane.js +60 -76
- package/lib/connection/enterprise/hrd_screen.js +60 -75
- package/lib/connection/enterprise/kerberos_screen.js +46 -60
- package/lib/connection/enterprise/quick_auth_screen.js +46 -64
- package/lib/connection/enterprise/single_sign_on_notice.js +14 -26
- package/lib/connection/enterprise.js +51 -84
- package/lib/connection/passwordless/actions.js +29 -62
- package/lib/connection/passwordless/ask_vcode.js +53 -60
- package/lib/connection/passwordless/email_sent_confirmation.js +129 -179
- package/lib/connection/passwordless/index.js +36 -68
- package/lib/connection/social/index.js +12 -15
- package/lib/core/actions.js +33 -85
- package/lib/core/client/index.js +38 -58
- package/lib/core/client/settings.js +12 -20
- package/lib/core/error_screen.js +38 -52
- package/lib/core/index.js +152 -301
- package/lib/core/loading_screen.js +61 -71
- package/lib/core/pane_separator.js +10 -10
- package/lib/core/remote_data.js +28 -48
- package/lib/core/screen.js +85 -79
- package/lib/core/signed_in_confirmation.js +51 -73
- package/lib/core/sso/data.js +9 -17
- package/lib/core/sso/index.js +5 -6
- package/lib/core/sso/last_login_screen.js +46 -63
- package/lib/core/tenant/index.js +37 -59
- package/lib/core/tenant/settings.js +11 -15
- package/lib/core/web_api/helper.js +24 -30
- package/lib/core/web_api/p2_api.js +156 -165
- package/lib/core/web_api.js +101 -90
- package/lib/core.js +126 -160
- package/lib/engine/classic/login.js +92 -144
- package/lib/engine/classic/mfa_login_screen.js +61 -67
- package/lib/engine/classic/sign_up_pane.js +89 -123
- package/lib/engine/classic/sign_up_screen.js +112 -158
- package/lib/engine/classic.js +122 -183
- package/lib/engine/passwordless/social_or_email_login_screen.js +71 -106
- package/lib/engine/passwordless/social_or_phone_number_login_screen.js +70 -100
- package/lib/engine/passwordless.js +75 -104
- package/lib/field/actions.js +11 -17
- package/lib/field/captcha/captcha_pane.js +82 -102
- package/lib/field/captcha/recaptcha.js +140 -145
- package/lib/field/captcha.js +7 -10
- package/lib/field/custom_input.js +37 -50
- package/lib/field/email/email_pane.js +90 -109
- package/lib/field/email.js +17 -35
- package/lib/field/index.js +51 -88
- package/lib/field/mfa-code/mfa_code_pane.js +57 -71
- package/lib/field/mfa_code.js +15 -21
- package/lib/field/option_selection_pane.js +16 -22
- package/lib/field/password/password_pane.js +79 -91
- package/lib/field/password.js +8 -14
- package/lib/field/phone-number/locations.js +7 -3
- package/lib/field/phone-number/phone_number_pane.js +87 -124
- package/lib/field/phone_number.js +16 -30
- package/lib/field/social/event.js +9 -12
- package/lib/field/social/social_buttons_pane.js +93 -121
- package/lib/field/username/username_pane.js +105 -123
- package/lib/field/username.js +16 -26
- package/lib/field/vcode/vcode_pane.js +67 -93
- package/lib/field/vcode.js +5 -5
- package/lib/i18n/af.js +7 -4
- package/lib/i18n/ar.js +7 -4
- package/lib/i18n/az.js +7 -4
- package/lib/i18n/bg.js +7 -4
- package/lib/i18n/ca.js +7 -4
- package/lib/i18n/cs.js +7 -4
- package/lib/i18n/da.js +7 -4
- package/lib/i18n/de.js +7 -3
- package/lib/i18n/el.js +7 -4
- package/lib/i18n/en.js +9 -4
- package/lib/i18n/es.js +7 -3
- package/lib/i18n/et.js +7 -4
- package/lib/i18n/fa.js +7 -4
- package/lib/i18n/fi.js +7 -4
- package/lib/i18n/fr.js +7 -4
- package/lib/i18n/he.js +7 -4
- package/lib/i18n/hr.js +7 -4
- package/lib/i18n/hu.js +7 -4
- package/lib/i18n/id.js +7 -4
- package/lib/i18n/it.js +7 -3
- package/lib/i18n/ja.js +7 -4
- package/lib/i18n/ko.js +7 -4
- package/lib/i18n/lt.js +7 -4
- package/lib/i18n/lv.js +7 -4
- package/lib/i18n/ms.js +7 -4
- package/lib/i18n/nb.js +7 -4
- package/lib/i18n/nl.js +7 -4
- package/lib/i18n/nn.js +7 -4
- package/lib/i18n/no.js +7 -4
- package/lib/i18n/pl.js +7 -4
- package/lib/i18n/pt-br.js +7 -3
- package/lib/i18n/pt.js +7 -4
- package/lib/i18n/ro.js +7 -4
- package/lib/i18n/ru.js +7 -4
- package/lib/i18n/sk.js +7 -4
- package/lib/i18n/sl.js +7 -4
- package/lib/i18n/sr.js +7 -4
- package/lib/i18n/sv.js +7 -4
- package/lib/i18n/tr.js +7 -4
- package/lib/i18n/ua.js +7 -4
- package/lib/i18n/uk.js +7 -4
- package/lib/i18n/vi.js +7 -4
- package/lib/i18n/zh-tw.js +7 -4
- package/lib/i18n/zh.js +7 -4
- package/lib/i18n.js +38 -75
- package/lib/index.js +14 -17
- package/lib/lock.js +29 -32
- package/lib/passwordless.js +29 -31
- package/lib/quick-auth/actions.js +19 -26
- package/lib/quick_auth.js +8 -10
- package/lib/sanitizer.js +5 -5
- package/lib/store/index.js +22 -42
- package/lib/sync.js +21 -42
- package/lib/ui/box/button.js +85 -105
- package/lib/ui/box/chrome.js +463 -548
- package/lib/ui/box/confirmation_pane.js +34 -48
- package/lib/ui/box/container.js +305 -339
- package/lib/ui/box/global_message.js +51 -60
- package/lib/ui/box/header.js +155 -177
- package/lib/ui/box/multisize_slide.js +233 -229
- package/lib/ui/box/success_pane.js +34 -37
- package/lib/ui/box.js +88 -93
- package/lib/ui/button/auth_button.js +44 -51
- package/lib/ui/input/captcha_input.js +162 -181
- package/lib/ui/input/checkbox_input.js +57 -59
- package/lib/ui/input/email_input.js +117 -124
- package/lib/ui/input/input_wrap.js +65 -80
- package/lib/ui/input/location_input.js +130 -150
- package/lib/ui/input/mfa_code_input.js +98 -98
- package/lib/ui/input/password/password_strength.js +103 -127
- package/lib/ui/input/password_input.js +141 -147
- package/lib/ui/input/phone_number_input.js +101 -109
- package/lib/ui/input/select_input.js +120 -132
- package/lib/ui/input/text_input.js +89 -84
- package/lib/ui/input/username_input.js +109 -115
- package/lib/ui/input/vcode_input.js +110 -118
- package/lib/ui/list.js +224 -247
- package/lib/ui/pane/quick_auth_pane.js +55 -80
- package/lib/utils/atom.js +55 -48
- package/lib/utils/cache.js +54 -43
- package/lib/utils/cdn_utils.js +17 -31
- package/lib/utils/createRef.js +3 -1
- package/lib/utils/data_utils.js +10 -16
- package/lib/utils/fn_utils.js +5 -4
- package/lib/utils/format.js +6 -8
- package/lib/utils/id_utils.js +4 -3
- package/lib/utils/jsonp_utils.js +20 -17
- package/lib/utils/media_utils.js +4 -2
- package/lib/utils/preload_utils.js +4 -3
- package/lib/utils/string_utils.js +4 -4
- package/lib/utils/url_utils.js +4 -3
- package/opslevel.yml +6 -0
- package/package.json +53 -38
- package/webpack.config.js +36 -3
package/lib/core/actions.js
CHANGED
|
@@ -1,67 +1,49 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.checkSession = checkSession;
|
|
7
|
+
exports.closeLock = closeLock;
|
|
8
8
|
exports.handleAuthCallback = handleAuthCallback;
|
|
9
|
-
exports.
|
|
9
|
+
exports.logIn = logIn;
|
|
10
|
+
exports.logInSuccess = logInSuccess;
|
|
10
11
|
exports.openLock = openLock;
|
|
11
|
-
exports.closeLock = closeLock;
|
|
12
|
-
exports.removeLock = removeLock;
|
|
13
|
-
exports.updateLock = updateLock;
|
|
14
12
|
exports.pinLoadingPane = pinLoadingPane;
|
|
13
|
+
exports.removeLock = removeLock;
|
|
14
|
+
exports.resumeAuth = resumeAuth;
|
|
15
|
+
exports.setupLock = setupLock;
|
|
15
16
|
exports.unpinLoadingPane = unpinLoadingPane;
|
|
17
|
+
exports.updateLock = updateLock;
|
|
16
18
|
exports.validateAndSubmit = validateAndSubmit;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
var _web_api = require('./web_api');
|
|
26
|
-
|
|
27
|
-
var _web_api2 = _interopRequireDefault(_web_api);
|
|
28
|
-
|
|
29
|
-
var _index = require('../store/index');
|
|
30
|
-
|
|
31
|
-
var _remote_data = require('./remote_data');
|
|
32
|
-
|
|
33
|
-
var _index2 = require('./index');
|
|
34
|
-
|
|
35
|
-
var l = _interopRequireWildcard(_index2);
|
|
36
|
-
|
|
37
|
-
var _preload_utils = require('../utils/preload_utils');
|
|
38
|
-
|
|
39
|
-
var _container = require('../ui/box/container');
|
|
40
|
-
|
|
41
|
-
var _index3 = require('../field/index');
|
|
42
|
-
|
|
43
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
44
|
-
|
|
19
|
+
var _immutable = _interopRequireWildcard(require("immutable"));
|
|
20
|
+
var _web_api = _interopRequireDefault(require("./web_api"));
|
|
21
|
+
var _index = require("../store/index");
|
|
22
|
+
var _remote_data = require("./remote_data");
|
|
23
|
+
var l = _interopRequireWildcard(require("./index"));
|
|
24
|
+
var _preload_utils = require("../utils/preload_utils");
|
|
25
|
+
var _container = require("../ui/box/container");
|
|
26
|
+
var _index3 = require("../field/index");
|
|
45
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
46
|
-
|
|
28
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
30
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
31
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
32
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
33
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
34
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
35
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
47
36
|
function setupLock(id, clientID, domain, options, hookRunner, emitEventFn, handleEventFn) {
|
|
48
37
|
var m = l.setup(id, clientID, domain, options, hookRunner, emitEventFn, handleEventFn);
|
|
49
|
-
|
|
50
38
|
m = (0, _remote_data.syncRemoteData)(m);
|
|
51
|
-
|
|
52
39
|
(0, _preload_utils.img)(l.ui.logo(m) || _container.defaultProps.logo);
|
|
53
|
-
|
|
54
|
-
_web_api2.default.setupClient(id, clientID, domain, l.withAuthOptions(m, _extends({}, options, {
|
|
40
|
+
_web_api.default.setupClient(id, clientID, domain, l.withAuthOptions(m, _objectSpread(_objectSpread({}, options), {}, {
|
|
55
41
|
popupOptions: l.ui.popupOptions(m)
|
|
56
42
|
})));
|
|
57
|
-
|
|
58
43
|
m = l.runHook(m, 'didInitialize', options);
|
|
59
|
-
|
|
60
44
|
(0, _index.swap)(_index.setEntity, 'lock', id, m);
|
|
61
|
-
|
|
62
45
|
return m;
|
|
63
46
|
}
|
|
64
|
-
|
|
65
47
|
function handleAuthCallback() {
|
|
66
48
|
var ms = (0, _index.read)(_index.getCollection, 'lock');
|
|
67
49
|
var keepHash = ms.filter(function (m) {
|
|
@@ -76,22 +58,19 @@ function handleAuthCallback() {
|
|
|
76
58
|
};
|
|
77
59
|
resumeAuth(window.location.hash, callback);
|
|
78
60
|
}
|
|
79
|
-
|
|
80
61
|
function resumeAuth(hash, callback) {
|
|
81
62
|
var ms = (0, _index.read)(_index.getCollection, 'lock');
|
|
82
63
|
ms.forEach(function (m) {
|
|
83
64
|
return l.auth.redirect(m) && parseHash(m, hash, callback);
|
|
84
65
|
});
|
|
85
66
|
}
|
|
86
|
-
|
|
87
67
|
function parseHash(m, hash, cb) {
|
|
88
|
-
|
|
68
|
+
_web_api.default.parseHash(l.id(m), hash, function (error, authResult) {
|
|
89
69
|
if (error) {
|
|
90
70
|
l.emitHashParsedEvent(m, error);
|
|
91
71
|
} else {
|
|
92
72
|
l.emitHashParsedEvent(m, authResult);
|
|
93
73
|
}
|
|
94
|
-
|
|
95
74
|
if (error) {
|
|
96
75
|
l.emitAuthorizationErrorEvent(m, error);
|
|
97
76
|
} else if (authResult) {
|
|
@@ -100,17 +79,14 @@ function parseHash(m, hash, cb) {
|
|
|
100
79
|
cb(error, authResult);
|
|
101
80
|
});
|
|
102
81
|
}
|
|
103
|
-
|
|
104
82
|
function openLock(id, opts) {
|
|
105
83
|
var m = (0, _index.read)(_index.getEntity, 'lock', id);
|
|
106
84
|
if (!m) {
|
|
107
85
|
throw new Error("The Lock can't be opened again after it has been destroyed");
|
|
108
86
|
}
|
|
109
|
-
|
|
110
87
|
if (l.rendering(m)) {
|
|
111
88
|
return false;
|
|
112
89
|
}
|
|
113
|
-
|
|
114
90
|
if (opts.flashMessage) {
|
|
115
91
|
var supportedTypes = ['error', 'success', 'info'];
|
|
116
92
|
if (!opts.flashMessage.type || supportedTypes.indexOf(opts.flashMessage.type) === -1) {
|
|
@@ -120,36 +96,29 @@ function openLock(id, opts) {
|
|
|
120
96
|
return l.emitUnrecoverableErrorEvent(m, "'flashMessage' must provide a text");
|
|
121
97
|
}
|
|
122
98
|
}
|
|
123
|
-
|
|
124
99
|
l.emitEvent(m, 'show');
|
|
125
|
-
|
|
126
100
|
(0, _index.swap)(_index.updateEntity, 'lock', id, function (m) {
|
|
127
101
|
m = l.overrideOptions(m, opts);
|
|
128
102
|
m = l.filterConnections(m);
|
|
129
103
|
m = l.runHook(m, 'willShow', opts);
|
|
130
104
|
return l.render(m);
|
|
131
105
|
});
|
|
132
|
-
|
|
133
106
|
return true;
|
|
134
107
|
}
|
|
135
|
-
|
|
136
108
|
function closeLock(id) {
|
|
137
109
|
var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
138
110
|
var callback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};
|
|
139
|
-
|
|
140
111
|
// Do nothing when the Lock can't be closed, unless closing is forced.
|
|
141
112
|
var m = (0, _index.read)(_index.getEntity, 'lock', id);
|
|
142
113
|
if (!l.ui.closable(m) && !force || !l.rendering(m)) {
|
|
143
114
|
return;
|
|
144
115
|
}
|
|
145
|
-
|
|
146
116
|
l.emitEvent(m, 'hide');
|
|
147
117
|
|
|
148
118
|
// If it is a modal, stop rendering an reset after a second,
|
|
149
119
|
// otherwise just reset.
|
|
150
120
|
if (l.ui.appendContainer(m)) {
|
|
151
121
|
(0, _index.swap)(_index.updateEntity, 'lock', id, l.stopRendering);
|
|
152
|
-
|
|
153
122
|
setTimeout(function () {
|
|
154
123
|
(0, _index.swap)(_index.updateEntity, 'lock', id, function (m) {
|
|
155
124
|
m = (0, _index3.hideInvalidFields)(m);
|
|
@@ -170,16 +139,13 @@ function closeLock(id) {
|
|
|
170
139
|
callback(m);
|
|
171
140
|
}
|
|
172
141
|
}
|
|
173
|
-
|
|
174
142
|
function removeLock(id) {
|
|
175
143
|
(0, _index.swap)(_index.updateEntity, 'lock', id, l.stopRendering);
|
|
176
144
|
(0, _index.swap)(_index.removeEntity, 'lock', id);
|
|
177
145
|
}
|
|
178
|
-
|
|
179
146
|
function updateLock(id, f) {
|
|
180
147
|
return (0, _index.swap)(_index.updateEntity, 'lock', id, f);
|
|
181
148
|
}
|
|
182
|
-
|
|
183
149
|
function pinLoadingPane(id) {
|
|
184
150
|
var lock = (0, _index.read)(_index.getEntity, 'lock', id);
|
|
185
151
|
if (!lock.get('isLoadingPanePinned')) {
|
|
@@ -188,17 +154,14 @@ function pinLoadingPane(id) {
|
|
|
188
154
|
});
|
|
189
155
|
}
|
|
190
156
|
}
|
|
191
|
-
|
|
192
157
|
function unpinLoadingPane(id) {
|
|
193
158
|
(0, _index.swap)(_index.updateEntity, 'lock', id, function (m) {
|
|
194
159
|
return m.set('isLoadingPanePinned', false);
|
|
195
160
|
});
|
|
196
161
|
}
|
|
197
|
-
|
|
198
162
|
function validateAndSubmit(id) {
|
|
199
163
|
var fields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
200
|
-
var f = arguments[2];
|
|
201
|
-
|
|
164
|
+
var f = arguments.length > 2 ? arguments[2] : undefined;
|
|
202
165
|
(0, _index.swap)(_index.updateEntity, 'lock', id, function (m) {
|
|
203
166
|
var allFieldsValid = fields.reduce(function (r, x) {
|
|
204
167
|
return r && (0, _index3.isFieldValid)(m, x);
|
|
@@ -208,26 +171,22 @@ function validateAndSubmit(id) {
|
|
|
208
171
|
}, m);
|
|
209
172
|
});
|
|
210
173
|
var m = (0, _index.read)(_index.getEntity, 'lock', id);
|
|
211
|
-
|
|
212
174
|
if (l.submitting(m)) {
|
|
213
175
|
f(m);
|
|
214
176
|
}
|
|
215
177
|
}
|
|
216
|
-
|
|
217
178
|
function logIn(id, fields) {
|
|
218
179
|
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
219
180
|
var logInErrorHandler = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function (_id, error, _fields, next) {
|
|
220
181
|
return next();
|
|
221
182
|
};
|
|
222
|
-
|
|
223
183
|
validateAndSubmit(id, fields, function (m) {
|
|
224
184
|
try {
|
|
225
185
|
// For now, always pass 'null' for the context as we don't need it yet.
|
|
226
186
|
// If we need it later, it'll save a breaking change in hooks already in use.
|
|
227
187
|
var context = null;
|
|
228
|
-
|
|
229
188
|
l.runHook(m, 'loggingIn', context, function () {
|
|
230
|
-
|
|
189
|
+
_web_api.default.logIn(id, params, l.auth.params(m).toJS(), function (error, result) {
|
|
231
190
|
if (error) {
|
|
232
191
|
setTimeout(function () {
|
|
233
192
|
return logInError(id, fields, error, logInErrorHandler);
|
|
@@ -244,25 +203,21 @@ function logIn(id, fields) {
|
|
|
244
203
|
}
|
|
245
204
|
});
|
|
246
205
|
}
|
|
247
|
-
|
|
248
206
|
function checkSession(id) {
|
|
249
207
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
250
|
-
|
|
251
208
|
var m = (0, _index.read)(_index.getEntity, 'lock', id);
|
|
252
209
|
(0, _index.swap)(_index.updateEntity, 'lock', id, function (m) {
|
|
253
210
|
return l.setSubmitting(m, true);
|
|
254
211
|
});
|
|
255
|
-
|
|
212
|
+
_web_api.default.checkSession(id, params, function (err, result) {
|
|
256
213
|
if (err) {
|
|
257
214
|
return logInError(id, [], err);
|
|
258
215
|
}
|
|
259
216
|
return logInSuccess(id, result);
|
|
260
217
|
});
|
|
261
218
|
}
|
|
262
|
-
|
|
263
219
|
function logInSuccess(id, result) {
|
|
264
220
|
var m = (0, _index.read)(_index.getEntity, 'lock', id);
|
|
265
|
-
|
|
266
221
|
if (!l.ui.autoclose(m)) {
|
|
267
222
|
(0, _index.swap)(_index.updateEntity, 'lock', id, function (m) {
|
|
268
223
|
m = l.setSubmitting(m, false);
|
|
@@ -275,31 +230,24 @@ function logInSuccess(id, result) {
|
|
|
275
230
|
});
|
|
276
231
|
}
|
|
277
232
|
}
|
|
278
|
-
|
|
279
233
|
function logInError(id, fields, error) {
|
|
280
234
|
var localHandler = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function (_id, _error, _fields, next) {
|
|
281
235
|
return next();
|
|
282
236
|
};
|
|
283
|
-
|
|
284
237
|
var errorCode = error.error || error.code;
|
|
285
|
-
|
|
286
238
|
localHandler(id, error, fields, function () {
|
|
287
239
|
return setTimeout(function () {
|
|
288
240
|
var m = (0, _index.read)(_index.getEntity, 'lock', id);
|
|
289
241
|
var errorMessage = l.loginErrorMessage(m, error, loginType(fields));
|
|
290
242
|
var errorCodesThatEmitAuthorizationErrorEvent = ['blocked_user', 'rule_error', 'lock.unauthorized', 'invalid_user_password', 'login_required'];
|
|
291
|
-
|
|
292
243
|
if (errorCodesThatEmitAuthorizationErrorEvent.indexOf(errorCode) > -1) {
|
|
293
244
|
l.emitAuthorizationErrorEvent(m, error);
|
|
294
245
|
}
|
|
295
|
-
|
|
296
246
|
(0, _index.swap)(_index.updateEntity, 'lock', id, l.setSubmitting, false, errorMessage);
|
|
297
247
|
}, 0);
|
|
298
248
|
});
|
|
299
|
-
|
|
300
249
|
(0, _index.swap)(_index.updateEntity, 'lock', id, l.setSubmitting, false);
|
|
301
250
|
}
|
|
302
|
-
|
|
303
251
|
function loginType(fields) {
|
|
304
252
|
if (!fields) return;
|
|
305
253
|
if (~fields.indexOf('vcode')) return 'code';
|
package/lib/core/client/index.js
CHANGED
|
@@ -1,61 +1,60 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.hasFreeSubscription = hasFreeSubscription;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.clientConnections = clientConnections;
|
|
10
7
|
exports.connection = connection;
|
|
8
|
+
exports.hasFreeSubscription = hasFreeSubscription;
|
|
11
9
|
exports.initClient = initClient;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
var _auth0PasswordPolicies = require('auth0-password-policies');
|
|
19
|
-
|
|
20
|
-
var _auth0PasswordPolicies2 = _interopRequireDefault(_auth0PasswordPolicies);
|
|
21
|
-
|
|
22
|
-
var _data_utils = require('../../utils/data_utils');
|
|
23
|
-
|
|
24
|
-
var _index = require('../../connection/social/index');
|
|
25
|
-
|
|
26
|
-
var _enterprise = require('../../connection/enterprise');
|
|
27
|
-
|
|
10
|
+
var _immutable = _interopRequireWildcard(require("immutable"));
|
|
11
|
+
var _auth0PasswordPolicies = _interopRequireDefault(require("auth0-password-policies"));
|
|
12
|
+
var _data_utils = require("../../utils/data_utils");
|
|
13
|
+
var _index = require("../../connection/social/index");
|
|
14
|
+
var _enterprise = require("../../connection/enterprise");
|
|
28
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
19
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
20
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
22
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
23
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
24
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
25
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
28
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
29
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
30
30
|
var _dataFns = (0, _data_utils.dataFns)(['client']),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
initNS = _dataFns.initNS,
|
|
32
|
+
get = _dataFns.get;
|
|
33
|
+
var DEFAULT_CONNECTION_VALIDATION = {
|
|
34
|
+
username: {
|
|
35
|
+
min: 1,
|
|
36
|
+
max: 15
|
|
37
|
+
}
|
|
38
|
+
};
|
|
36
39
|
function hasFreeSubscription(m) {
|
|
37
40
|
return ['free', 'dev'].indexOf(get(m, ['tenant', 'subscription'])) > -1;
|
|
38
41
|
}
|
|
39
|
-
|
|
40
42
|
function connection(m, strategyName, name) {
|
|
41
43
|
// TODO: this function should take a client, not a map with a client
|
|
42
44
|
// key.
|
|
43
45
|
var connections = strategy(m, strategyName).get('connections', (0, _immutable.List)());
|
|
44
46
|
return connections.find(withName(name)) || (0, _immutable.Map)();
|
|
45
47
|
}
|
|
46
|
-
|
|
47
48
|
function strategy(m, name) {
|
|
48
49
|
// TODO: this function should take a client, not a map with a client
|
|
49
50
|
// key.
|
|
50
51
|
return m.getIn(['client', 'strategies'], (0, _immutable.List)()).find(withName(name)) || (0, _immutable.Map)();
|
|
51
52
|
}
|
|
52
|
-
|
|
53
53
|
function withName(name) {
|
|
54
54
|
return function (x) {
|
|
55
55
|
return x.get('name') === name;
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
|
|
59
58
|
function strategyNameToConnectionType(str) {
|
|
60
59
|
if (str === 'auth0') {
|
|
61
60
|
return 'database';
|
|
@@ -71,30 +70,23 @@ function strategyNameToConnectionType(str) {
|
|
|
71
70
|
return 'unknown';
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
|
-
|
|
75
73
|
function formatConnectionValidation() {
|
|
76
74
|
var connectionValidation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
77
|
-
|
|
78
75
|
if (connectionValidation.username == null) {
|
|
79
76
|
return null;
|
|
80
77
|
}
|
|
81
|
-
|
|
82
|
-
var validation = _extends({}, DEFAULT_CONNECTION_VALIDATION, connectionValidation);
|
|
78
|
+
var validation = _objectSpread(_objectSpread({}, DEFAULT_CONNECTION_VALIDATION), connectionValidation);
|
|
83
79
|
var defaultMin = DEFAULT_CONNECTION_VALIDATION.username.min;
|
|
84
80
|
var defaultMax = DEFAULT_CONNECTION_VALIDATION.username.max;
|
|
85
|
-
|
|
86
81
|
validation.username.min = parseInt(validation.username.min, 10) || defaultMin;
|
|
87
82
|
validation.username.max = parseInt(validation.username.max, 10) || defaultMax;
|
|
88
|
-
|
|
89
83
|
if (validation.username.min > validation.username.max) {
|
|
90
84
|
validation.username.min = defaultMin;
|
|
91
85
|
validation.username.max = defaultMax;
|
|
92
86
|
}
|
|
93
|
-
|
|
94
87
|
return validation;
|
|
95
88
|
}
|
|
96
|
-
|
|
97
|
-
var emptyConnections = _immutable2.default.fromJS({
|
|
89
|
+
var emptyConnections = _immutable.default.fromJS({
|
|
98
90
|
database: [],
|
|
99
91
|
enterprise: [],
|
|
100
92
|
passwordless: [],
|
|
@@ -105,9 +97,8 @@ var emptyConnections = _immutable2.default.fromJS({
|
|
|
105
97
|
function initClient(m, client) {
|
|
106
98
|
return initNS(m, formatClient(client));
|
|
107
99
|
}
|
|
108
|
-
|
|
109
100
|
function formatClient(o) {
|
|
110
|
-
return new
|
|
101
|
+
return new _immutable.default.fromJS({
|
|
111
102
|
id: o.id,
|
|
112
103
|
tenant: {
|
|
113
104
|
name: o.tenant,
|
|
@@ -116,29 +107,22 @@ function formatClient(o) {
|
|
|
116
107
|
connections: formatClientConnections(o)
|
|
117
108
|
});
|
|
118
109
|
}
|
|
119
|
-
|
|
120
110
|
function formatClientConnections(o) {
|
|
121
111
|
var result = emptyConnections.toJS();
|
|
122
|
-
|
|
123
112
|
var _loop = function _loop() {
|
|
124
113
|
var _result$connectionTyp;
|
|
125
|
-
|
|
126
114
|
var strategy = o.strategies[i];
|
|
127
115
|
var connectionType = strategyNameToConnectionType(strategy.name);
|
|
128
|
-
|
|
129
116
|
var connections = strategy.connections.map(function (connection) {
|
|
130
117
|
return formatClientConnection(connectionType, strategy.name, connection);
|
|
131
118
|
});
|
|
132
|
-
(_result$connectionTyp = result[connectionType]).push.apply(_result$connectionTyp, connections);
|
|
119
|
+
(_result$connectionTyp = result[connectionType]).push.apply(_result$connectionTyp, _toConsumableArray(connections));
|
|
133
120
|
};
|
|
134
|
-
|
|
135
121
|
for (var i = 0; i < (o.strategies || []).length; i++) {
|
|
136
122
|
_loop();
|
|
137
123
|
}
|
|
138
|
-
|
|
139
124
|
return result;
|
|
140
125
|
}
|
|
141
|
-
|
|
142
126
|
function formatClientConnection(connectionType, strategyName, connection) {
|
|
143
127
|
var result = {
|
|
144
128
|
name: connection.name,
|
|
@@ -146,9 +130,8 @@ function formatClientConnection(connectionType, strategyName, connection) {
|
|
|
146
130
|
type: connectionType,
|
|
147
131
|
displayName: connection.display_name
|
|
148
132
|
};
|
|
149
|
-
|
|
150
133
|
if (connectionType === 'database') {
|
|
151
|
-
result.passwordPolicy =
|
|
134
|
+
result.passwordPolicy = _auth0PasswordPolicies.default[connection.passwordPolicy || 'none'];
|
|
152
135
|
if (connection.password_complexity_options && connection.password_complexity_options.min_length) {
|
|
153
136
|
result.passwordPolicy.length.minLength = connection.password_complexity_options.min_length;
|
|
154
137
|
}
|
|
@@ -157,7 +140,6 @@ function formatClientConnection(connectionType, strategyName, connection) {
|
|
|
157
140
|
result.requireUsername = typeof connection.requires_username === 'boolean' ? connection.requires_username : false;
|
|
158
141
|
result.validation = formatConnectionValidation(connection.validation);
|
|
159
142
|
}
|
|
160
|
-
|
|
161
143
|
if (connectionType === 'enterprise') {
|
|
162
144
|
var domains = connection.domain_aliases || [];
|
|
163
145
|
if (connection.domain) {
|
|
@@ -165,10 +147,8 @@ function formatClientConnection(connectionType, strategyName, connection) {
|
|
|
165
147
|
}
|
|
166
148
|
result.domains = domains;
|
|
167
149
|
}
|
|
168
|
-
|
|
169
150
|
return result;
|
|
170
151
|
}
|
|
171
|
-
|
|
172
152
|
function clientConnections(m) {
|
|
173
153
|
return get(m, 'connections', emptyConnections);
|
|
174
154
|
}
|
|
@@ -1,36 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
4
7
|
exports.fetchClientSettings = fetchClientSettings;
|
|
5
8
|
exports.syncClientSettingsSuccess = syncClientSettingsSuccess;
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var _index = require('../index');
|
|
14
|
-
|
|
15
|
-
var l = _interopRequireWildcard(_index);
|
|
16
|
-
|
|
17
|
-
var _index2 = require('./index');
|
|
18
|
-
|
|
19
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
20
|
-
|
|
9
|
+
var _urlJoin = _interopRequireDefault(require("url-join"));
|
|
10
|
+
var _cdn_utils = require("../../utils/cdn_utils");
|
|
11
|
+
var l = _interopRequireWildcard(require("../index"));
|
|
12
|
+
var _index2 = require("./index");
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
-
|
|
23
16
|
function fetchClientSettings(clientID, clientBaseUrl, cb) {
|
|
24
17
|
(0, _cdn_utils.load)({
|
|
25
18
|
method: 'setClient',
|
|
26
|
-
url: (0,
|
|
19
|
+
url: (0, _urlJoin.default)(clientBaseUrl, 'client', "".concat(clientID, ".js?t").concat(+new Date())),
|
|
27
20
|
check: function check(o) {
|
|
28
21
|
return o && o.id === clientID;
|
|
29
22
|
},
|
|
30
23
|
cb: cb
|
|
31
24
|
});
|
|
32
25
|
}
|
|
33
|
-
|
|
34
26
|
function syncClientSettingsSuccess(m, result) {
|
|
35
27
|
m = (0, _index2.initClient)(m, result);
|
|
36
28
|
m = l.filterConnections(m);
|