auth0-lock 11.35.0 → 12.0.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 +3 -1
- package/.shiprc +4 -5
- package/CHANGELOG.md +25 -0
- package/DEVELOPMENT.md +1 -1
- package/README.md +20 -16
- 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 +24 -47
- package/lib/__tests__/connection/database/password_reset_confirmation.js +23 -32
- package/lib/__tests__/connection/database/reset_password.js +17 -39
- package/lib/__tests__/connection/database/signed_up_confirmation.js +23 -32
- 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 +32 -75
- package/lib/__tests__/connection/passwordless/ask_vcode.js +29 -51
- package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +23 -32
- 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 +23 -32
- 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/social_or_email_login_screen.js +7 -28
- package/lib/__tests__/engine/passwordless/social_or_phone_number_login_screen.js +7 -28
- 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 +23 -42
- 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 +15 -34
- 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 -65
- 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 +154 -305
- package/lib/core/loading_screen.js +61 -71
- package/lib/core/pane_separator.js +10 -10
- package/lib/core/remote_data.js +30 -51
- 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 +22 -28
- package/lib/core/web_api/p2_api.js +162 -171
- package/lib/core/web_api.js +106 -94
- 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 +80 -116
- package/lib/engine/passwordless/social_or_phone_number_login_screen.js +79 -110
- package/lib/engine/passwordless.js +75 -104
- package/lib/field/actions.js +11 -17
- package/lib/field/captcha/captcha_pane.js +83 -103
- 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 +50 -87
- 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/package.json +48 -34
- package/webpack.config.js +36 -3
package/lib/i18n.js
CHANGED
|
@@ -1,95 +1,65 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.str = str;
|
|
8
|
-
exports.html = html;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
9
6
|
exports.group = group;
|
|
7
|
+
exports.html = html;
|
|
10
8
|
exports.initI18n = initI18n;
|
|
11
|
-
|
|
12
|
-
var _react = require(
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
var _dompurify = require('dompurify');
|
|
25
|
-
|
|
26
|
-
var _sync = require('./sync');
|
|
27
|
-
|
|
28
|
-
var _sync2 = _interopRequireDefault(_sync);
|
|
29
|
-
|
|
30
|
-
var _index = require('./core/index');
|
|
31
|
-
|
|
32
|
-
var l = _interopRequireWildcard(_index);
|
|
33
|
-
|
|
34
|
-
var _data_utils = require('./utils/data_utils');
|
|
35
|
-
|
|
36
|
-
var _en = require('./i18n/en');
|
|
37
|
-
|
|
38
|
-
var _en2 = _interopRequireDefault(_en);
|
|
39
|
-
|
|
40
|
-
var _cdn_utils = require('./utils/cdn_utils');
|
|
41
|
-
|
|
42
|
-
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; } }
|
|
43
|
-
|
|
9
|
+
exports.str = str;
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _immutable = _interopRequireWildcard(require("immutable"));
|
|
12
|
+
var _format = _interopRequireDefault(require("./utils/format"));
|
|
13
|
+
var _dompurify = require("dompurify");
|
|
14
|
+
var _sync = _interopRequireDefault(require("./sync"));
|
|
15
|
+
var l = _interopRequireWildcard(require("./core/index"));
|
|
16
|
+
var _data_utils = require("./utils/data_utils");
|
|
17
|
+
var _en = _interopRequireDefault(require("./i18n/en"));
|
|
18
|
+
var _cdn_utils = require("./utils/cdn_utils");
|
|
19
|
+
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); }
|
|
20
|
+
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; }
|
|
44
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
45
|
-
|
|
22
|
+
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); }
|
|
46
23
|
var _dataFns = (0, _data_utils.dataFns)(['i18n']),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
24
|
+
get = _dataFns.get,
|
|
25
|
+
set = _dataFns.set;
|
|
50
26
|
function str(m, keyPath) {
|
|
51
|
-
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
27
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
52
28
|
args[_key - 2] = arguments[_key];
|
|
53
29
|
}
|
|
54
|
-
|
|
55
|
-
return _format2.default.apply(undefined, [get(m, ['strings'].concat(keyPath), '')].concat(args));
|
|
30
|
+
return _format.default.apply(void 0, [get(m, ['strings'].concat(keyPath), '')].concat(args));
|
|
56
31
|
}
|
|
57
|
-
|
|
58
32
|
function html(m, keyPath) {
|
|
59
|
-
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
33
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
60
34
|
args[_key2 - 2] = arguments[_key2];
|
|
61
35
|
}
|
|
62
|
-
|
|
63
|
-
var html = str.apply(undefined, [m, keyPath].concat(args));
|
|
36
|
+
var html = str.apply(void 0, [m, keyPath].concat(args));
|
|
64
37
|
// dangerouslySetInnerHTML input is sanitized using dompurify
|
|
65
38
|
// eslint-disable-next-line react/no-danger
|
|
66
|
-
return html ?
|
|
39
|
+
return html ? /*#__PURE__*/_react.default.createElement('span', {
|
|
40
|
+
dangerouslySetInnerHTML: {
|
|
41
|
+
__html: (0, _dompurify.sanitize)(html)
|
|
42
|
+
}
|
|
43
|
+
}) : null;
|
|
67
44
|
}
|
|
68
|
-
|
|
69
45
|
function group(m, keyPath) {
|
|
70
46
|
return get(m, ['strings'].concat(keyPath), (0, _immutable.Map)()).toJS();
|
|
71
47
|
}
|
|
72
|
-
|
|
73
48
|
function initI18n(m) {
|
|
74
49
|
var language = l.ui.language(m);
|
|
75
50
|
var overrides = l.ui.dict(m);
|
|
76
|
-
var defaultDictionary =
|
|
77
|
-
|
|
51
|
+
var defaultDictionary = _immutable.default.fromJS(_en.default);
|
|
78
52
|
var base = languageDictionaries[language] || (0, _immutable.Map)({});
|
|
79
|
-
|
|
80
53
|
if (base.isEmpty()) {
|
|
81
54
|
base = overrides;
|
|
82
|
-
m = (0,
|
|
55
|
+
m = (0, _sync.default)(m, 'i18n', {
|
|
83
56
|
syncFn: function syncFn(_, cb) {
|
|
84
57
|
return syncLang(m, language, cb);
|
|
85
58
|
},
|
|
86
59
|
successFn: function successFn(m, result) {
|
|
87
60
|
registerLanguageDictionary(language, result);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
assertLanguage(m, overrided.toJS(), _en2.default);
|
|
92
|
-
|
|
61
|
+
var overrided = _immutable.default.fromJS(result).mergeDeep(overrides);
|
|
62
|
+
assertLanguage(m, overrided.toJS(), _en.default);
|
|
93
63
|
return set(m, 'strings', defaultDictionary.mergeDeep(overrided));
|
|
94
64
|
},
|
|
95
65
|
recoverResult: m,
|
|
@@ -98,23 +68,19 @@ function initI18n(m) {
|
|
|
98
68
|
}
|
|
99
69
|
});
|
|
100
70
|
} else {
|
|
101
|
-
assertLanguage(m, base.toJS(),
|
|
71
|
+
assertLanguage(m, base.toJS(), _en.default);
|
|
102
72
|
}
|
|
103
|
-
|
|
104
73
|
base = defaultDictionary.mergeDeep(base).mergeDeep(overrides);
|
|
105
|
-
|
|
106
74
|
return set(m, 'strings', base);
|
|
107
75
|
}
|
|
108
|
-
|
|
109
76
|
function assertLanguage(m, language, base) {
|
|
110
77
|
var path = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
|
111
|
-
|
|
112
78
|
Object.keys(base).forEach(function (key) {
|
|
113
79
|
if (!language.hasOwnProperty(key)) {
|
|
114
|
-
l.warn(m,
|
|
80
|
+
l.warn(m, "language does not have property ".concat(path).concat(key));
|
|
115
81
|
} else {
|
|
116
82
|
if (_typeof(base[key]) === 'object') {
|
|
117
|
-
assertLanguage(m, language[key], base[key],
|
|
83
|
+
assertLanguage(m, language[key], base[key], "".concat(path).concat(key, "."));
|
|
118
84
|
}
|
|
119
85
|
}
|
|
120
86
|
});
|
|
@@ -125,7 +91,7 @@ function assertLanguage(m, language, base) {
|
|
|
125
91
|
function syncLang(m, language, _cb) {
|
|
126
92
|
(0, _cdn_utils.load)({
|
|
127
93
|
method: 'registerLanguageDictionary',
|
|
128
|
-
url: l.languageBaseUrl(m)
|
|
94
|
+
url: "".concat(l.languageBaseUrl(m), "/js/lock/").concat("12.0.0", "/").concat(language, ".js"),
|
|
129
95
|
check: function check(str) {
|
|
130
96
|
return str && str === language;
|
|
131
97
|
},
|
|
@@ -134,13 +100,10 @@ function syncLang(m, language, _cb) {
|
|
|
134
100
|
}
|
|
135
101
|
});
|
|
136
102
|
}
|
|
137
|
-
|
|
138
103
|
var languageDictionaries = [];
|
|
139
|
-
|
|
140
104
|
function registerLanguageDictionary(language, dictionary) {
|
|
141
|
-
languageDictionaries[language] =
|
|
105
|
+
languageDictionaries[language] = _immutable.default.fromJS(dictionary);
|
|
142
106
|
}
|
|
143
|
-
|
|
144
107
|
if (typeof window !== 'undefined') {
|
|
145
108
|
(0, _cdn_utils.preload)({
|
|
146
109
|
method: 'registerLanguageDictionary',
|
package/lib/index.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var _passwordless = require('./passwordless');
|
|
11
|
-
|
|
12
|
-
var _passwordless2 = _interopRequireDefault(_passwordless);
|
|
13
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Auth0LockPasswordless = exports.Auth0Lock = void 0;
|
|
7
|
+
var _lock = _interopRequireDefault(require("./lock"));
|
|
8
|
+
var _passwordless = _interopRequireDefault(require("./passwordless"));
|
|
14
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var Auth0Lock =
|
|
18
|
-
exports.
|
|
10
|
+
var Auth0LockPasswordless = _passwordless.default;
|
|
11
|
+
exports.Auth0LockPasswordless = Auth0LockPasswordless;
|
|
12
|
+
var Auth0Lock = _lock.default;
|
|
13
|
+
exports.Auth0Lock = Auth0Lock;
|
|
14
|
+
var _default = _lock.default;
|
|
15
|
+
exports.default = _default;
|
package/lib/lock.js
CHANGED
|
@@ -1,48 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _classic = require(
|
|
10
|
-
|
|
11
|
-
var _classic2 = _interopRequireDefault(_classic);
|
|
12
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
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
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _core = _interopRequireWildcard(require("./core"));
|
|
9
|
+
var _classic = _interopRequireDefault(require("./engine/classic"));
|
|
13
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
14
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
15
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
|
+
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); }
|
|
15
17
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
19
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
20
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
21
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
22
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
23
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
25
|
+
var Auth0Lock = /*#__PURE__*/function (_Core) {
|
|
22
26
|
_inherits(Auth0Lock, _Core);
|
|
23
|
-
|
|
27
|
+
var _super = _createSuper(Auth0Lock);
|
|
24
28
|
function Auth0Lock(clientID, domain, options) {
|
|
29
|
+
var _this;
|
|
25
30
|
_classCallCheck(this, Auth0Lock);
|
|
26
|
-
|
|
27
|
-
var _this = _possibleConstructorReturn(this, _Core.call(this, clientID, domain, options, _classic2.default));
|
|
28
|
-
|
|
31
|
+
_this = _super.call(this, clientID, domain, options, _classic.default);
|
|
29
32
|
(0, _core.injectStyles)();
|
|
30
33
|
(0, _core.setWindowHeightStyle)();
|
|
31
|
-
|
|
32
34
|
window.addEventListener('resize', function () {
|
|
33
35
|
(0, _core.setWindowHeightStyle)();
|
|
34
36
|
});
|
|
35
37
|
return _this;
|
|
36
38
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}(_core2.default);
|
|
40
|
-
|
|
41
|
-
// telemetry
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
return _createClass(Auth0Lock);
|
|
40
|
+
}(_core.default); // telemetry
|
|
44
41
|
exports.default = Auth0Lock;
|
|
45
|
-
Auth0Lock.version =
|
|
42
|
+
Auth0Lock.version = "12.0.0";
|
|
46
43
|
|
|
47
44
|
// TODO: should we have different telemetry for classic/passwordless?
|
|
48
45
|
// TODO: should we set telemetry info before each request?
|
package/lib/passwordless.js
CHANGED
|
@@ -1,44 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _passwordless = require(
|
|
10
|
-
|
|
11
|
-
var _passwordless2 = _interopRequireDefault(_passwordless);
|
|
12
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
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
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _core = _interopRequireWildcard(require("./core"));
|
|
9
|
+
var _passwordless = _interopRequireDefault(require("./engine/passwordless"));
|
|
13
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
14
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
15
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
|
+
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); }
|
|
15
17
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
19
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
20
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
21
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
22
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
23
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
25
|
+
var Auth0LockPasswordless = /*#__PURE__*/function (_Core) {
|
|
22
26
|
_inherits(Auth0LockPasswordless, _Core);
|
|
23
|
-
|
|
27
|
+
var _super = _createSuper(Auth0LockPasswordless);
|
|
24
28
|
function Auth0LockPasswordless(clientID, domain, options) {
|
|
29
|
+
var _this;
|
|
25
30
|
_classCallCheck(this, Auth0LockPasswordless);
|
|
26
|
-
|
|
27
|
-
var _this = _possibleConstructorReturn(this, _Core.call(this, clientID, domain, options, _passwordless2.default));
|
|
28
|
-
|
|
31
|
+
_this = _super.call(this, clientID, domain, options, _passwordless.default);
|
|
29
32
|
(0, _core.injectStyles)();
|
|
30
33
|
(0, _core.setWindowHeightStyle)();
|
|
31
|
-
|
|
32
34
|
window.addEventListener('resize', function () {
|
|
33
35
|
(0, _core.setWindowHeightStyle)();
|
|
34
36
|
});
|
|
35
37
|
return _this;
|
|
36
38
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}(_core2.default);
|
|
40
|
-
|
|
39
|
+
return _createClass(Auth0LockPasswordless);
|
|
40
|
+
}(_core.default);
|
|
41
41
|
exports.default = Auth0LockPasswordless;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Auth0LockPasswordless.version = '11.35.0';
|
|
42
|
+
Auth0LockPasswordless.version = "12.0.0";
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.skipQuickAuth = skipQuickAuth;
|
|
8
|
-
exports.logIn = logIn;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
9
6
|
exports.checkSession = checkSession;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _index = require(
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
7
|
+
exports.logIn = logIn;
|
|
8
|
+
exports.skipQuickAuth = skipQuickAuth;
|
|
9
|
+
var _quick_auth = require("../quick_auth");
|
|
10
|
+
var _index = require("../store/index");
|
|
11
|
+
var _actions = require("../core/actions");
|
|
12
|
+
var l = _interopRequireWildcard(require("../core/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; }
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
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); }
|
|
23
21
|
function skipQuickAuth(id) {
|
|
24
22
|
(0, _index.swap)(_index.updateEntity, 'lock', id, _quick_auth.skipQuickAuth, true);
|
|
25
23
|
}
|
|
26
|
-
|
|
27
24
|
function logIn(id, connection, loginHint, prompt) {
|
|
28
25
|
var m = (0, _index.read)(_index.getEntity, 'lock', id);
|
|
29
26
|
var connectionScopes = l.auth.connectionScopes(m);
|
|
@@ -41,17 +38,14 @@ function logIn(id, connection, loginHint, prompt) {
|
|
|
41
38
|
if (prompt) {
|
|
42
39
|
params.prompt = prompt;
|
|
43
40
|
}
|
|
44
|
-
|
|
45
41
|
if (connection.get('strategy') === 'apple') {
|
|
46
42
|
(0, _index.swap)(_index.updateEntity, 'lock', l.id(m), l.setSupressSubmitOverlay, true);
|
|
47
43
|
} else {
|
|
48
44
|
(0, _index.swap)(_index.updateEntity, 'lock', l.id(m), l.setSupressSubmitOverlay, false);
|
|
49
45
|
}
|
|
50
|
-
|
|
51
46
|
params.isSubmitting = false;
|
|
52
47
|
(0, _actions.logIn)(id, [], params);
|
|
53
48
|
}
|
|
54
|
-
|
|
55
49
|
function checkSession(id, connection, loginHint) {
|
|
56
50
|
var m = (0, _index.read)(_index.getEntity, 'lock', id);
|
|
57
51
|
if (l.auth.responseType(m).indexOf('code') >= 0) {
|
|
@@ -61,10 +55,9 @@ function checkSession(id, connection, loginHint) {
|
|
|
61
55
|
} else {
|
|
62
56
|
var connectionScopes = l.auth.connectionScopes(m);
|
|
63
57
|
var scopes = connectionScopes.get(connection.get('name'));
|
|
64
|
-
var params =
|
|
58
|
+
var params = _objectSpread(_objectSpread({}, l.auth.params(m).toJS()), {}, {
|
|
65
59
|
connection: connection.get('name')
|
|
66
60
|
});
|
|
67
|
-
|
|
68
61
|
(0, _actions.checkSession)(id, params);
|
|
69
62
|
}
|
|
70
63
|
}
|
package/lib/quick_auth.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
4
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
5
6
|
exports.hasSkippedQuickAuth = hasSkippedQuickAuth;
|
|
6
|
-
|
|
7
|
-
var _data_utils = require(
|
|
8
|
-
|
|
7
|
+
exports.skipQuickAuth = skipQuickAuth;
|
|
8
|
+
var _data_utils = require("./utils/data_utils");
|
|
9
9
|
var _dataFns = (0, _data_utils.dataFns)(['quickAuth']),
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
tget = _dataFns.tget,
|
|
11
|
+
tset = _dataFns.tset;
|
|
13
12
|
function skipQuickAuth(m, b) {
|
|
14
13
|
return tset(m, 'skipped', b);
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
function hasSkippedQuickAuth(m) {
|
|
18
16
|
return tget(m, 'skipped', false);
|
|
19
17
|
}
|
package/lib/sanitizer.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
4
6
|
exports.initSanitizer = initSanitizer;
|
|
5
|
-
|
|
6
|
-
var _dompurify = require('dompurify');
|
|
7
|
-
|
|
7
|
+
var _dompurify = require("dompurify");
|
|
8
8
|
function initSanitizer() {
|
|
9
9
|
// Extracted from the example at
|
|
10
10
|
// https://github.com/cure53/DOMPurify/blob/main/demos/hooks-target-blank-demo.html
|
package/lib/store/index.js
CHANGED
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getCollection = getCollection;
|
|
7
|
+
exports.getEntity = getEntity;
|
|
8
|
+
exports.getState = getState;
|
|
4
9
|
exports.observe = observe;
|
|
5
|
-
exports.subscribe = subscribe;
|
|
6
|
-
exports.unsubscribe = unsubscribe;
|
|
7
|
-
exports.swap = swap;
|
|
8
|
-
exports.updateEntity = updateEntity;
|
|
9
|
-
exports.setEntity = setEntity;
|
|
10
10
|
exports.read = read;
|
|
11
|
-
exports.getEntity = getEntity;
|
|
12
11
|
exports.removeEntity = removeEntity;
|
|
13
|
-
exports.
|
|
12
|
+
exports.setEntity = setEntity;
|
|
13
|
+
exports.subscribe = subscribe;
|
|
14
|
+
exports.swap = swap;
|
|
15
|
+
exports.unsubscribe = unsubscribe;
|
|
14
16
|
exports.updateCollection = updateCollection;
|
|
15
|
-
exports.
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
var _atom2 = _interopRequireDefault(_atom);
|
|
20
|
-
|
|
21
|
-
var _immutable = require('immutable');
|
|
22
|
-
|
|
17
|
+
exports.updateEntity = updateEntity;
|
|
18
|
+
var _atom = _interopRequireDefault(require("../utils/atom"));
|
|
19
|
+
var _immutable = require("immutable");
|
|
23
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
|
|
25
|
-
var store = (0, _atom2.default)(new _immutable.Map({}));
|
|
26
|
-
|
|
21
|
+
var store = (0, _atom.default)(new _immutable.Map({}));
|
|
27
22
|
function observe(key, id, f) {
|
|
28
|
-
subscribe(key
|
|
23
|
+
subscribe("".concat(key, "-").concat(id), function (_, oldState, newState) {
|
|
29
24
|
var m = getEntity(newState, 'lock', id);
|
|
30
25
|
var oldM = getEntity(oldState, 'lock', id);
|
|
31
26
|
if (m && !m.equals(oldM)) {
|
|
@@ -33,68 +28,53 @@ function observe(key, id, f) {
|
|
|
33
28
|
}
|
|
34
29
|
});
|
|
35
30
|
}
|
|
36
|
-
|
|
37
31
|
function subscribe(key, f) {
|
|
38
32
|
store.addWatch(key, f);
|
|
39
33
|
}
|
|
40
|
-
|
|
41
34
|
function unsubscribe(key) {
|
|
42
35
|
store.removeWatch(key);
|
|
43
36
|
}
|
|
44
|
-
|
|
45
37
|
function swap() {
|
|
46
38
|
return store.swap.apply(store, arguments);
|
|
47
39
|
}
|
|
48
|
-
|
|
49
40
|
function updateEntity(state, coll, id, f) {
|
|
50
|
-
for (var _len = arguments.length, args = Array(_len > 4 ? _len - 4 : 0), _key = 4; _key < _len; _key++) {
|
|
41
|
+
for (var _len = arguments.length, args = new Array(_len > 4 ? _len - 4 : 0), _key = 4; _key < _len; _key++) {
|
|
51
42
|
args[_key - 4] = arguments[_key];
|
|
52
43
|
}
|
|
53
|
-
|
|
54
44
|
return state.updateIn([coll, id], new _immutable.Map({}), function (x) {
|
|
55
|
-
return f.apply(
|
|
45
|
+
return f.apply(void 0, [x].concat(args));
|
|
56
46
|
});
|
|
57
47
|
}
|
|
58
|
-
|
|
59
48
|
function setEntity(state, coll, id, m) {
|
|
60
49
|
return state.setIn([coll, id], m);
|
|
61
50
|
}
|
|
62
|
-
|
|
63
51
|
function read(f) {
|
|
64
|
-
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
52
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
65
53
|
args[_key2 - 1] = arguments[_key2];
|
|
66
54
|
}
|
|
67
|
-
|
|
68
|
-
return f.apply(undefined, [store.deref()].concat(args));
|
|
55
|
+
return f.apply(void 0, [store.deref()].concat(args));
|
|
69
56
|
}
|
|
70
|
-
|
|
71
57
|
function getEntity(state, coll) {
|
|
72
58
|
var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
73
|
-
|
|
74
59
|
return state.getIn([coll, id]);
|
|
75
60
|
}
|
|
76
|
-
|
|
77
61
|
function removeEntity(state, coll) {
|
|
78
62
|
var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
79
|
-
|
|
80
63
|
return state.removeIn([coll, id]);
|
|
81
64
|
}
|
|
82
|
-
|
|
83
65
|
function getCollection(state, coll) {
|
|
84
66
|
return state.get(coll, (0, _immutable.Map)()).toList();
|
|
85
67
|
}
|
|
86
68
|
|
|
87
69
|
// TODO: try to remove this fn
|
|
88
70
|
function updateCollection(state, coll, f) {
|
|
89
|
-
for (var _len3 = arguments.length, args = Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
|
|
71
|
+
for (var _len3 = arguments.length, args = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
|
|
90
72
|
args[_key3 - 3] = arguments[_key3];
|
|
91
73
|
}
|
|
92
|
-
|
|
93
74
|
return state.update(coll, function (xs) {
|
|
94
|
-
return f.apply(
|
|
75
|
+
return f.apply(void 0, [xs].concat(args));
|
|
95
76
|
});
|
|
96
77
|
}
|
|
97
|
-
|
|
98
78
|
function getState() {
|
|
99
79
|
return store.deref();
|
|
100
80
|
}
|