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
|
@@ -1,92 +1,70 @@
|
|
|
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
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
4
8
|
exports.renderSignedInConfirmation = renderSignedInConfirmation;
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var _success_pane = require('../ui/box/success_pane');
|
|
15
|
-
|
|
16
|
-
var _success_pane2 = _interopRequireDefault(_success_pane);
|
|
17
|
-
|
|
18
|
-
var _actions = require('./actions');
|
|
19
|
-
|
|
20
|
-
var _index = require('./index');
|
|
21
|
-
|
|
22
|
-
var l = _interopRequireWildcard(_index);
|
|
23
|
-
|
|
24
|
-
var _i18n = require('../i18n');
|
|
25
|
-
|
|
26
|
-
var i18n = _interopRequireWildcard(_i18n);
|
|
27
|
-
|
|
28
|
-
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; } }
|
|
29
|
-
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _success_pane = _interopRequireDefault(require("../ui/box/success_pane"));
|
|
12
|
+
var _actions = require("./actions");
|
|
13
|
+
var l = _interopRequireWildcard(require("./index"));
|
|
14
|
+
var i18n = _interopRequireWildcard(require("../i18n"));
|
|
15
|
+
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); }
|
|
16
|
+
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
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
-
|
|
32
18
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
19
|
+
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); } }
|
|
20
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
22
|
+
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
|
+
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); }
|
|
24
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
25
|
+
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); }; }
|
|
26
|
+
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); }
|
|
27
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
28
|
+
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; } }
|
|
29
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
38
30
|
// TODO: can't we get this from pops?
|
|
39
|
-
|
|
40
|
-
var SignedInConfirmation = function (_React$Component) {
|
|
31
|
+
var SignedInConfirmation = /*#__PURE__*/function (_React$Component) {
|
|
41
32
|
_inherits(SignedInConfirmation, _React$Component);
|
|
42
|
-
|
|
33
|
+
var _super = _createSuper(SignedInConfirmation);
|
|
43
34
|
function SignedInConfirmation() {
|
|
44
35
|
_classCallCheck(this, SignedInConfirmation);
|
|
45
|
-
|
|
46
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
36
|
+
return _super.apply(this, arguments);
|
|
47
37
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
null,
|
|
68
|
-
i18n.html(lock, ['success', 'logIn'])
|
|
69
|
-
)
|
|
70
|
-
);
|
|
71
|
-
};
|
|
72
|
-
|
|
38
|
+
_createClass(SignedInConfirmation, [{
|
|
39
|
+
key: "handleClose",
|
|
40
|
+
value: function handleClose() {
|
|
41
|
+
var _this$props = this.props,
|
|
42
|
+
closeHandler = _this$props.closeHandler,
|
|
43
|
+
lock = _this$props.lock;
|
|
44
|
+
closeHandler(l.id(lock));
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
key: "render",
|
|
48
|
+
value: function render() {
|
|
49
|
+
var lock = this.props.lock;
|
|
50
|
+
var closeHandler = l.ui.closable(lock) ? this.handleClose.bind(this) : undefined;
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_success_pane.default, {
|
|
52
|
+
lock: lock,
|
|
53
|
+
closeHandler: closeHandler
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement("p", null, i18n.html(lock, ['success', 'logIn'])));
|
|
55
|
+
}
|
|
56
|
+
}]);
|
|
73
57
|
return SignedInConfirmation;
|
|
74
|
-
}(
|
|
75
|
-
|
|
58
|
+
}(_react.default.Component);
|
|
76
59
|
exports.default = SignedInConfirmation;
|
|
77
|
-
|
|
78
|
-
|
|
79
60
|
SignedInConfirmation.propTypes = {
|
|
80
|
-
closeHandler:
|
|
81
|
-
lock:
|
|
61
|
+
closeHandler: _propTypes.default.func.isRequired,
|
|
62
|
+
lock: _propTypes.default.object.isRequired
|
|
82
63
|
};
|
|
83
|
-
|
|
84
64
|
function renderSignedInConfirmation(lock) {
|
|
85
65
|
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
86
|
-
|
|
87
66
|
props.closeHandler = _actions.closeLock;
|
|
88
67
|
props.key = 'auxiliarypane';
|
|
89
68
|
props.lock = lock;
|
|
90
|
-
|
|
91
|
-
return l.loggedIn(lock) ? _react2.default.createElement(SignedInConfirmation, props) : null;
|
|
69
|
+
return l.loggedIn(lock) ? /*#__PURE__*/_react.default.createElement(SignedInConfirmation, props) : null;
|
|
92
70
|
}
|
package/lib/core/sso/data.js
CHANGED
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
4
6
|
exports.fetchSSOData = fetchSSOData;
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
var _web_api2 = _interopRequireDefault(_web_api);
|
|
9
|
-
|
|
10
|
-
var _cache = require('../../utils/cache');
|
|
11
|
-
|
|
12
|
-
var _cache2 = _interopRequireDefault(_cache);
|
|
13
|
-
|
|
7
|
+
var _web_api = _interopRequireDefault(require("../web_api"));
|
|
8
|
+
var _cache = _interopRequireDefault(require("../../utils/cache"));
|
|
14
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return _web_api2.default.getSSOData.apply(_web_api2.default, arguments);
|
|
10
|
+
var cache = new _cache.default(function () {
|
|
11
|
+
return _web_api.default.getSSOData.apply(_web_api.default, arguments);
|
|
18
12
|
});
|
|
19
|
-
|
|
20
13
|
function fetchSSOData(id) {
|
|
21
|
-
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
14
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
22
15
|
args[_key - 1] = arguments[_key];
|
|
23
16
|
}
|
|
24
|
-
|
|
25
17
|
cache.get.apply(cache, [id].concat(args));
|
|
26
18
|
}
|
package/lib/core/sso/index.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
4
6
|
exports.lastUsedConnection = lastUsedConnection;
|
|
5
7
|
exports.lastUsedUsername = lastUsedUsername;
|
|
6
|
-
|
|
7
|
-
var _immutable = require('immutable');
|
|
8
|
-
|
|
8
|
+
var _immutable = require("immutable");
|
|
9
9
|
function lastUsedConnection(m) {
|
|
10
10
|
return m.getIn(['sso', 'lastUsedConnection']);
|
|
11
11
|
}
|
|
12
|
-
|
|
13
12
|
function lastUsedUsername(m) {
|
|
14
13
|
return m.getIn(['sso', 'lastUsedUsername'], '');
|
|
15
14
|
}
|
|
@@ -1,41 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _screen = require(
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
var _index = require('./index');
|
|
20
|
-
|
|
21
|
-
var _index2 = require('../index');
|
|
22
|
-
|
|
23
|
-
var l = _interopRequireWildcard(_index2);
|
|
24
|
-
|
|
25
|
-
var _signed_in_confirmation = require('../signed_in_confirmation');
|
|
26
|
-
|
|
27
|
-
var _index3 = require('../../connection/social/index');
|
|
28
|
-
|
|
29
|
-
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; } }
|
|
30
|
-
|
|
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 _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _screen = _interopRequireDefault(require("../screen"));
|
|
10
|
+
var _quick_auth_pane = _interopRequireDefault(require("../../ui/pane/quick_auth_pane"));
|
|
11
|
+
var _actions = require("../../quick-auth/actions");
|
|
12
|
+
var _index = require("./index");
|
|
13
|
+
var l = _interopRequireWildcard(require("../index"));
|
|
14
|
+
var _signed_in_confirmation = require("../signed_in_confirmation");
|
|
15
|
+
var _index3 = require("../../connection/social/index");
|
|
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; }
|
|
31
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
|
-
|
|
33
19
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
34
|
-
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
function
|
|
38
|
-
|
|
20
|
+
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); } }
|
|
21
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
22
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
23
|
+
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); }
|
|
24
|
+
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); }
|
|
25
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
26
|
+
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); }; }
|
|
27
|
+
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); }
|
|
28
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
29
|
+
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; } }
|
|
30
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
31
|
// TODO: handle this from CSS
|
|
40
32
|
function icon(strategy) {
|
|
41
33
|
if (_index3.STRATEGIES[strategy]) return strategy;
|
|
@@ -43,24 +35,17 @@ function icon(strategy) {
|
|
|
43
35
|
if (~['adfs', 'office365', 'waad'].indexOf(strategy)) return 'windows';
|
|
44
36
|
return 'auth0';
|
|
45
37
|
}
|
|
46
|
-
|
|
47
38
|
var Component = function Component(_ref) {
|
|
48
39
|
var i18n = _ref.i18n,
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
model = _ref.model;
|
|
51
41
|
var headerText = i18n.html('lastLoginInstructions') || null;
|
|
52
|
-
var header = headerText &&
|
|
53
|
-
'p',
|
|
54
|
-
null,
|
|
55
|
-
headerText
|
|
56
|
-
);
|
|
42
|
+
var header = headerText && /*#__PURE__*/_react.default.createElement("p", null, headerText);
|
|
57
43
|
var theme = (0, _index3.authButtonsTheme)(model);
|
|
58
44
|
var connectionName = (0, _index.lastUsedConnection)(model).get('name');
|
|
59
45
|
var buttonTheme = theme.get(connectionName);
|
|
60
46
|
var primaryColor = buttonTheme && buttonTheme.get('primaryColor');
|
|
61
47
|
var foregroundColor = buttonTheme && buttonTheme.get('foregroundColor');
|
|
62
48
|
var buttonIcon = buttonTheme && buttonTheme.get('icon');
|
|
63
|
-
|
|
64
49
|
var buttonClickHandler = function buttonClickHandler() {
|
|
65
50
|
var isUniversalLogin = window.location.host === l.domain(model);
|
|
66
51
|
if (isUniversalLogin) {
|
|
@@ -70,8 +55,7 @@ var Component = function Component(_ref) {
|
|
|
70
55
|
}
|
|
71
56
|
};
|
|
72
57
|
var buttonLabel = (0, _index.lastUsedUsername)(model) || _index3.STRATEGIES[connectionName] || connectionName;
|
|
73
|
-
|
|
74
|
-
return _react2.default.createElement(_quick_auth_pane2.default, {
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(_quick_auth_pane.default, {
|
|
75
59
|
alternativeLabel: i18n.str('notYourAccountAction'),
|
|
76
60
|
alternativeClickHandler: function alternativeClickHandler() {
|
|
77
61
|
return (0, _actions.skipQuickAuth)(l.id(model));
|
|
@@ -85,25 +69,24 @@ var Component = function Component(_ref) {
|
|
|
85
69
|
foregroundColor: foregroundColor
|
|
86
70
|
});
|
|
87
71
|
};
|
|
88
|
-
|
|
89
|
-
var LastLoginScreen = function (_Screen) {
|
|
72
|
+
var LastLoginScreen = /*#__PURE__*/function (_Screen) {
|
|
90
73
|
_inherits(LastLoginScreen, _Screen);
|
|
91
|
-
|
|
74
|
+
var _super = _createSuper(LastLoginScreen);
|
|
92
75
|
function LastLoginScreen() {
|
|
93
76
|
_classCallCheck(this, LastLoginScreen);
|
|
94
|
-
|
|
95
|
-
return _possibleConstructorReturn(this, _Screen.call(this, 'lastLogin'));
|
|
77
|
+
return _super.call(this, 'lastLogin');
|
|
96
78
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
79
|
+
_createClass(LastLoginScreen, [{
|
|
80
|
+
key: "renderAuxiliaryPane",
|
|
81
|
+
value: function renderAuxiliaryPane(lock) {
|
|
82
|
+
return (0, _signed_in_confirmation.renderSignedInConfirmation)(lock);
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
key: "render",
|
|
86
|
+
value: function render() {
|
|
87
|
+
return Component;
|
|
88
|
+
}
|
|
89
|
+
}]);
|
|
106
90
|
return LastLoginScreen;
|
|
107
|
-
}(
|
|
108
|
-
|
|
91
|
+
}(_screen.default);
|
|
109
92
|
exports.default = LastLoginScreen;
|
package/lib/core/tenant/index.js
CHANGED
|
@@ -1,61 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.initTenant = initTenant;
|
|
8
|
-
exports.tenantConnections = tenantConnections;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
9
6
|
exports.defaultDirectory = defaultDirectory;
|
|
10
7
|
exports.defaultDirectoryName = defaultDirectoryName;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
var _auth0PasswordPolicies2 = _interopRequireDefault(_auth0PasswordPolicies);
|
|
19
|
-
|
|
20
|
-
var _data_utils = require('../../utils/data_utils');
|
|
21
|
-
|
|
22
|
-
var _index = require('../index');
|
|
23
|
-
|
|
24
|
-
var l = _interopRequireWildcard(_index);
|
|
25
|
-
|
|
26
|
-
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; } }
|
|
27
|
-
|
|
8
|
+
exports.initTenant = initTenant;
|
|
9
|
+
exports.tenantConnections = tenantConnections;
|
|
10
|
+
var _immutable = _interopRequireWildcard(require("immutable"));
|
|
11
|
+
var _auth0PasswordPolicies = _interopRequireDefault(require("auth0-password-policies"));
|
|
12
|
+
var _data_utils = require("../../utils/data_utils");
|
|
13
|
+
var l = _interopRequireWildcard(require("../index"));
|
|
28
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
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); }
|
|
18
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
19
|
+
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."); }
|
|
20
|
+
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); }
|
|
21
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
22
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
23
|
+
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; }
|
|
24
|
+
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; }
|
|
25
|
+
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; }
|
|
26
|
+
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; }
|
|
27
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
28
|
+
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
29
|
var _dataFns = (0, _data_utils.dataFns)(['client']),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
initNS = _dataFns.initNS,
|
|
31
|
+
get = _dataFns.get;
|
|
32
|
+
var DEFAULT_CONNECTION_VALIDATION = {
|
|
33
|
+
username: {
|
|
34
|
+
min: 1,
|
|
35
|
+
max: 15
|
|
36
|
+
}
|
|
37
|
+
};
|
|
36
38
|
function formatConnectionValidation() {
|
|
37
39
|
var connectionValidation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
38
|
-
|
|
39
40
|
if (connectionValidation.username == null) {
|
|
40
41
|
return null;
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
var validation = _extends({}, DEFAULT_CONNECTION_VALIDATION, connectionValidation);
|
|
43
|
+
var validation = _objectSpread(_objectSpread({}, DEFAULT_CONNECTION_VALIDATION), connectionValidation);
|
|
44
44
|
var defaultMin = DEFAULT_CONNECTION_VALIDATION.username.min;
|
|
45
45
|
var defaultMax = DEFAULT_CONNECTION_VALIDATION.username.max;
|
|
46
|
-
|
|
47
46
|
validation.username.min = parseInt(validation.username.min, 10) || defaultMin;
|
|
48
47
|
validation.username.max = parseInt(validation.username.max, 10) || defaultMax;
|
|
49
|
-
|
|
50
48
|
if (validation.username.min > validation.username.max) {
|
|
51
49
|
validation.username.min = defaultMin;
|
|
52
50
|
validation.username.max = defaultMax;
|
|
53
51
|
}
|
|
54
|
-
|
|
55
52
|
return validation;
|
|
56
53
|
}
|
|
57
|
-
|
|
58
|
-
var emptyConnections = _immutable2.default.fromJS({
|
|
54
|
+
var emptyConnections = _immutable.default.fromJS({
|
|
59
55
|
database: [],
|
|
60
56
|
enterprise: [],
|
|
61
57
|
passwordless: [],
|
|
@@ -66,78 +62,60 @@ var emptyConnections = _immutable2.default.fromJS({
|
|
|
66
62
|
function initTenant(m, client_id, client) {
|
|
67
63
|
return initNS(m, formatTenant(client_id, client));
|
|
68
64
|
}
|
|
69
|
-
|
|
70
65
|
function formatTenant(client_id, o) {
|
|
71
|
-
return new
|
|
66
|
+
return new _immutable.default.fromJS({
|
|
72
67
|
connections: formatTenantConnections(client_id, o),
|
|
73
68
|
defaultDirectory: o.defaultDirectory || null
|
|
74
69
|
});
|
|
75
70
|
}
|
|
76
|
-
|
|
77
71
|
function formatTenantConnections(client_id, o) {
|
|
78
72
|
var result = emptyConnections.toJS();
|
|
79
73
|
var connectionTypes = Object.keys(o.connections).filter(function (name) {
|
|
80
74
|
return name != 'passwordless';
|
|
81
75
|
}); // disabled until lock supports passwordless connections within the same engine
|
|
82
76
|
var connections_filter = null;
|
|
83
|
-
|
|
84
77
|
if (o.clientsConnections && o.clientsConnections[client_id]) {
|
|
85
78
|
connections_filter = o.clientsConnections[client_id];
|
|
86
79
|
}
|
|
87
|
-
|
|
88
80
|
connectionTypes.forEach(function (connectionTypeName) {
|
|
89
81
|
var _result$connectionTyp;
|
|
90
|
-
|
|
91
82
|
var connections = o.connections[connectionTypeName].map(function (connection) {
|
|
92
83
|
return formatTenantConnection(connectionTypeName, connection);
|
|
93
84
|
}).filter(function (connection) {
|
|
94
85
|
return connections_filter === null || connections_filter.includes(connection.name);
|
|
95
86
|
});
|
|
96
|
-
(_result$connectionTyp = result[connectionTypeName]).push.apply(_result$connectionTyp, connections);
|
|
87
|
+
(_result$connectionTyp = result[connectionTypeName]).push.apply(_result$connectionTyp, _toConsumableArray(connections));
|
|
97
88
|
});
|
|
98
|
-
|
|
99
89
|
return result;
|
|
100
90
|
}
|
|
101
|
-
|
|
102
91
|
function formatTenantConnection(connectionType, connection) {
|
|
103
92
|
var result = {
|
|
104
93
|
name: connection.name,
|
|
105
94
|
strategy: connection.strategy,
|
|
106
95
|
type: connectionType
|
|
107
96
|
};
|
|
108
|
-
|
|
109
97
|
if (connectionType === 'database') {
|
|
110
98
|
if (connection.validation && connection.validation.passwordPolicy) {
|
|
111
99
|
result.passwordPolicy = connection.validation.passwordPolicy;
|
|
112
100
|
}
|
|
113
|
-
|
|
114
|
-
result.passwordPolicy = _auth0PasswordPolicies2.default[result.passwordPolicy || 'none'];
|
|
115
|
-
|
|
101
|
+
result.passwordPolicy = _auth0PasswordPolicies.default[result.passwordPolicy || 'none'];
|
|
116
102
|
result.allowSignup = typeof connection.allowSignup === 'boolean' ? connection.allowSignup : true;
|
|
117
|
-
|
|
118
103
|
result.allowForgot = typeof connection.allowForgot === 'boolean' ? connection.allowForgot : true;
|
|
119
|
-
|
|
120
104
|
result.requireUsername = typeof connection.requiresUsername === 'boolean' ? connection.requiresUsername : false;
|
|
121
|
-
|
|
122
105
|
result.validation = formatConnectionValidation(connection.validation);
|
|
123
106
|
}
|
|
124
|
-
|
|
125
107
|
if (connectionType === 'enterprise') {
|
|
126
108
|
result.domains = connection.domains;
|
|
127
109
|
}
|
|
128
|
-
|
|
129
110
|
return result;
|
|
130
111
|
}
|
|
131
|
-
|
|
132
112
|
function tenantConnections(m) {
|
|
133
113
|
return get(m, 'connections', emptyConnections);
|
|
134
114
|
}
|
|
135
|
-
|
|
136
115
|
function defaultDirectory(m) {
|
|
137
116
|
var name = defaultDirectoryName(m);
|
|
138
117
|
return name && l.findConnection(m, name);
|
|
139
118
|
}
|
|
140
|
-
|
|
141
119
|
function defaultDirectoryName(m) {
|
|
142
120
|
return get(m, 'defaultDirectory', null);
|
|
143
121
|
}
|
|
@@ -1,30 +1,26 @@
|
|
|
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.fetchTenantSettings = fetchTenantSettings;
|
|
5
8
|
exports.syncTenantSettingsSuccess = syncTenantSettingsSuccess;
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var l = _interopRequireWildcard(_index);
|
|
12
|
-
|
|
13
|
-
var _index2 = require('./index');
|
|
14
|
-
|
|
15
|
-
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; } }
|
|
16
|
-
|
|
9
|
+
var _cdn_utils = require("../../utils/cdn_utils");
|
|
10
|
+
var l = _interopRequireWildcard(require("../index"));
|
|
11
|
+
var _index2 = require("./index");
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
17
14
|
function fetchTenantSettings(tenantBaseUrl, cb) {
|
|
18
15
|
(0, _cdn_utils.load)({
|
|
19
16
|
method: 'setTenant',
|
|
20
|
-
url: tenantBaseUrl
|
|
17
|
+
url: "".concat(tenantBaseUrl, "?t").concat(+new Date()),
|
|
21
18
|
check: function check() {
|
|
22
19
|
return true;
|
|
23
20
|
},
|
|
24
21
|
cb: cb
|
|
25
22
|
});
|
|
26
23
|
}
|
|
27
|
-
|
|
28
24
|
function syncTenantSettingsSuccess(m, client_id, result) {
|
|
29
25
|
m = (0, _index2.initTenant)(m, client_id, result);
|
|
30
26
|
m = l.filterConnections(m);
|