auth0-lock 11.34.2 → 12.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +1 -0
- package/.circleci/config.yml +4 -2
- package/.eslintrc.json +5 -5
- package/.github/workflows/codeql.yml +41 -0
- package/.shiprc +4 -5
- package/CHANGELOG.md +26 -0
- package/EXAMPLES.md +626 -0
- package/README.md +77 -649
- package/karma.conf.js +1 -1
- package/lib/CSSCore.js +1 -4
- package/lib/__tests__/auth_button.js +12 -22
- package/lib/__tests__/connection/database/actions.js +48 -49
- package/lib/__tests__/connection/database/index.js +22 -28
- package/lib/__tests__/connection/database/login_pane.js +20 -41
- package/lib/__tests__/connection/database/password_reset_confirmation.js +19 -26
- package/lib/__tests__/connection/database/reset_password.js +17 -39
- package/lib/__tests__/connection/database/signed_up_confirmation.js +19 -26
- package/lib/__tests__/connection/enterprise/actions.js +22 -47
- package/lib/__tests__/connection/enterprise/hrd_pane.js +16 -33
- package/lib/__tests__/connection/enterprise/hrd_screen.js +26 -40
- package/lib/__tests__/connection/enterprise/quick_auth_screen.js +27 -68
- package/lib/__tests__/connection/passwordless/ask_vcode.js +29 -51
- package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +19 -26
- package/lib/__tests__/connection/passwordless/passwordless.js +35 -97
- package/lib/__tests__/core/actions.js +23 -46
- package/lib/__tests__/core/client/index.js +10 -13
- package/lib/__tests__/core/index.js +46 -94
- package/lib/__tests__/core/remote_data.js +14 -20
- package/lib/__tests__/core/signed_in_confirmation.js +19 -26
- package/lib/__tests__/core/sso/last_login_screen.js +27 -50
- package/lib/__tests__/core/tenant.js +10 -12
- package/lib/__tests__/core/web_api/helper.js +6 -14
- package/lib/__tests__/core/web_api/p2_api.js +38 -33
- package/lib/__tests__/core/web_api.js +37 -33
- package/lib/__tests__/engine/classic/login.js +20 -41
- package/lib/__tests__/engine/classic/mfa_login_screen.js +6 -19
- package/lib/__tests__/engine/classic/sign_up_pane.js +33 -55
- package/lib/__tests__/engine/classic/sign_up_screen.js +18 -45
- package/lib/__tests__/engine/classic.js +13 -6
- package/lib/__tests__/engine/passwordless.js +2 -5
- package/lib/__tests__/field/captcha/recaptcha_enterprise.js +27 -27
- package/lib/__tests__/field/captcha/recaptchav2.js +27 -27
- package/lib/__tests__/field/captcha.js +39 -51
- package/lib/__tests__/field/custom_input.js +23 -47
- package/lib/__tests__/field/email.js +2 -3
- package/lib/__tests__/field/email_pane.js +25 -48
- package/lib/__tests__/field/field.js +9 -13
- package/lib/__tests__/field/login_pane.js +30 -34
- package/lib/__tests__/field/mfa_code_pane.js +13 -28
- package/lib/__tests__/field/option_selection_pane.js +7 -25
- package/lib/__tests__/field/password.js +6 -12
- package/lib/__tests__/field/password_pane.js +29 -46
- package/lib/__tests__/field/phone_number_pane.js +18 -41
- package/lib/__tests__/field/social_buttons_pane.js +30 -47
- package/lib/__tests__/field/username.js +27 -48
- package/lib/__tests__/field/username_pane.js +30 -47
- package/lib/__tests__/field/vcode.js +5 -13
- package/lib/__tests__/field/vcode_pane.js +20 -44
- package/lib/__tests__/i18n.js +28 -53
- package/lib/__tests__/quick-auth/actions.js +4 -27
- package/lib/__tests__/setup-tests.js +7 -9
- package/lib/__tests__/testUtils.js +41 -58
- package/lib/__tests__/ui/box/chrome.js +24 -49
- package/lib/__tests__/ui/box/confirmation_pane.js +19 -36
- package/lib/__tests__/ui/box/container.js +21 -46
- package/lib/__tests__/ui/box/global_message.js +60 -37
- package/lib/__tests__/ui/input/email_input.js +6 -17
- package/lib/__tests__/ui/input/input_wrap.js +6 -19
- package/lib/__tests__/ui/input/password/password_strength.js +13 -15
- package/lib/__tests__/ui/input/password_input.js +22 -27
- package/lib/__tests__/utils/format.js +10 -17
- package/lib/__tests__/utils/url_utils.js +2 -5
- package/lib/avatar/gravatar_provider.js +13 -28
- package/lib/avatar.js +22 -41
- package/lib/browser.js +372 -23
- package/lib/connection/captcha.js +14 -32
- package/lib/connection/database/actions.js +39 -108
- package/lib/connection/database/index.js +90 -191
- package/lib/connection/database/login_pane.js +107 -147
- package/lib/connection/database/login_sign_up_tabs.js +106 -125
- package/lib/connection/database/mfa_pane.js +50 -69
- package/lib/connection/database/password_reset_confirmation.js +51 -73
- package/lib/connection/database/reset_password.js +116 -132
- package/lib/connection/database/reset_password_pane.js +45 -56
- package/lib/connection/database/sign_up_terms.js +17 -23
- package/lib/connection/database/signed_up_confirmation.js +52 -75
- package/lib/connection/enterprise/actions.js +23 -52
- package/lib/connection/enterprise/hrd_pane.js +60 -76
- package/lib/connection/enterprise/hrd_screen.js +60 -75
- package/lib/connection/enterprise/kerberos_screen.js +46 -60
- package/lib/connection/enterprise/quick_auth_screen.js +46 -64
- package/lib/connection/enterprise/single_sign_on_notice.js +14 -26
- package/lib/connection/enterprise.js +51 -84
- package/lib/connection/passwordless/actions.js +29 -62
- package/lib/connection/passwordless/ask_vcode.js +53 -60
- package/lib/connection/passwordless/email_sent_confirmation.js +129 -179
- package/lib/connection/passwordless/index.js +36 -68
- package/lib/connection/social/index.js +12 -15
- package/lib/core/actions.js +33 -85
- package/lib/core/client/index.js +38 -58
- package/lib/core/client/settings.js +12 -20
- package/lib/core/error_screen.js +38 -52
- package/lib/core/index.js +152 -301
- package/lib/core/loading_screen.js +61 -71
- package/lib/core/pane_separator.js +10 -10
- package/lib/core/remote_data.js +28 -48
- package/lib/core/screen.js +85 -79
- package/lib/core/signed_in_confirmation.js +51 -73
- package/lib/core/sso/data.js +9 -17
- package/lib/core/sso/index.js +5 -6
- package/lib/core/sso/last_login_screen.js +46 -63
- package/lib/core/tenant/index.js +37 -59
- package/lib/core/tenant/settings.js +11 -15
- package/lib/core/web_api/helper.js +24 -30
- package/lib/core/web_api/p2_api.js +156 -165
- package/lib/core/web_api.js +101 -90
- package/lib/core.js +126 -160
- package/lib/engine/classic/login.js +92 -144
- package/lib/engine/classic/mfa_login_screen.js +61 -67
- package/lib/engine/classic/sign_up_pane.js +89 -123
- package/lib/engine/classic/sign_up_screen.js +112 -158
- package/lib/engine/classic.js +122 -183
- package/lib/engine/passwordless/social_or_email_login_screen.js +71 -106
- package/lib/engine/passwordless/social_or_phone_number_login_screen.js +70 -100
- package/lib/engine/passwordless.js +75 -104
- package/lib/field/actions.js +11 -17
- package/lib/field/captcha/captcha_pane.js +82 -102
- package/lib/field/captcha/recaptcha.js +140 -145
- package/lib/field/captcha.js +7 -10
- package/lib/field/custom_input.js +37 -50
- package/lib/field/email/email_pane.js +90 -109
- package/lib/field/email.js +17 -35
- package/lib/field/index.js +51 -88
- package/lib/field/mfa-code/mfa_code_pane.js +57 -71
- package/lib/field/mfa_code.js +15 -21
- package/lib/field/option_selection_pane.js +16 -22
- package/lib/field/password/password_pane.js +79 -91
- package/lib/field/password.js +8 -14
- package/lib/field/phone-number/locations.js +7 -3
- package/lib/field/phone-number/phone_number_pane.js +87 -124
- package/lib/field/phone_number.js +16 -30
- package/lib/field/social/event.js +9 -12
- package/lib/field/social/social_buttons_pane.js +93 -121
- package/lib/field/username/username_pane.js +105 -123
- package/lib/field/username.js +16 -26
- package/lib/field/vcode/vcode_pane.js +67 -93
- package/lib/field/vcode.js +5 -5
- package/lib/i18n/af.js +7 -4
- package/lib/i18n/ar.js +7 -4
- package/lib/i18n/az.js +7 -4
- package/lib/i18n/bg.js +7 -4
- package/lib/i18n/ca.js +7 -4
- package/lib/i18n/cs.js +7 -4
- package/lib/i18n/da.js +7 -4
- package/lib/i18n/de.js +7 -3
- package/lib/i18n/el.js +7 -4
- package/lib/i18n/en.js +9 -4
- package/lib/i18n/es.js +7 -3
- package/lib/i18n/et.js +7 -4
- package/lib/i18n/fa.js +7 -4
- package/lib/i18n/fi.js +7 -4
- package/lib/i18n/fr.js +7 -4
- package/lib/i18n/he.js +7 -4
- package/lib/i18n/hr.js +7 -4
- package/lib/i18n/hu.js +7 -4
- package/lib/i18n/id.js +7 -4
- package/lib/i18n/it.js +7 -3
- package/lib/i18n/ja.js +7 -4
- package/lib/i18n/ko.js +7 -4
- package/lib/i18n/lt.js +7 -4
- package/lib/i18n/lv.js +7 -4
- package/lib/i18n/ms.js +7 -4
- package/lib/i18n/nb.js +7 -4
- package/lib/i18n/nl.js +7 -4
- package/lib/i18n/nn.js +7 -4
- package/lib/i18n/no.js +7 -4
- package/lib/i18n/pl.js +7 -4
- package/lib/i18n/pt-br.js +7 -3
- package/lib/i18n/pt.js +7 -4
- package/lib/i18n/ro.js +7 -4
- package/lib/i18n/ru.js +7 -4
- package/lib/i18n/sk.js +7 -4
- package/lib/i18n/sl.js +7 -4
- package/lib/i18n/sr.js +7 -4
- package/lib/i18n/sv.js +7 -4
- package/lib/i18n/tr.js +7 -4
- package/lib/i18n/ua.js +7 -4
- package/lib/i18n/uk.js +7 -4
- package/lib/i18n/vi.js +7 -4
- package/lib/i18n/zh-tw.js +7 -4
- package/lib/i18n/zh.js +7 -4
- package/lib/i18n.js +38 -75
- package/lib/index.js +14 -17
- package/lib/lock.js +29 -32
- package/lib/passwordless.js +29 -31
- package/lib/quick-auth/actions.js +19 -26
- package/lib/quick_auth.js +8 -10
- package/lib/sanitizer.js +5 -5
- package/lib/store/index.js +22 -42
- package/lib/sync.js +21 -42
- package/lib/ui/box/button.js +85 -105
- package/lib/ui/box/chrome.js +463 -548
- package/lib/ui/box/confirmation_pane.js +34 -48
- package/lib/ui/box/container.js +305 -339
- package/lib/ui/box/global_message.js +51 -60
- package/lib/ui/box/header.js +155 -177
- package/lib/ui/box/multisize_slide.js +233 -229
- package/lib/ui/box/success_pane.js +34 -37
- package/lib/ui/box.js +88 -93
- package/lib/ui/button/auth_button.js +44 -51
- package/lib/ui/input/captcha_input.js +162 -181
- package/lib/ui/input/checkbox_input.js +57 -59
- package/lib/ui/input/email_input.js +117 -124
- package/lib/ui/input/input_wrap.js +65 -80
- package/lib/ui/input/location_input.js +130 -150
- package/lib/ui/input/mfa_code_input.js +98 -98
- package/lib/ui/input/password/password_strength.js +103 -127
- package/lib/ui/input/password_input.js +141 -147
- package/lib/ui/input/phone_number_input.js +101 -109
- package/lib/ui/input/select_input.js +120 -132
- package/lib/ui/input/text_input.js +89 -84
- package/lib/ui/input/username_input.js +109 -115
- package/lib/ui/input/vcode_input.js +110 -118
- package/lib/ui/list.js +224 -247
- package/lib/ui/pane/quick_auth_pane.js +55 -80
- package/lib/utils/atom.js +55 -48
- package/lib/utils/cache.js +54 -43
- package/lib/utils/cdn_utils.js +17 -31
- package/lib/utils/createRef.js +3 -1
- package/lib/utils/data_utils.js +10 -16
- package/lib/utils/fn_utils.js +5 -4
- package/lib/utils/format.js +6 -8
- package/lib/utils/id_utils.js +4 -3
- package/lib/utils/jsonp_utils.js +20 -17
- package/lib/utils/media_utils.js +4 -2
- package/lib/utils/preload_utils.js +4 -3
- package/lib/utils/string_utils.js +4 -4
- package/lib/utils/url_utils.js +4 -3
- package/opslevel.yml +6 -0
- package/package.json +53 -38
- package/webpack.config.js +36 -3
|
@@ -1,125 +1,95 @@
|
|
|
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
|
|
20
|
-
|
|
21
|
-
var _social_buttons_pane2 = _interopRequireDefault(_social_buttons_pane);
|
|
22
|
-
|
|
23
|
-
var _signed_in_confirmation = require('../../core/signed_in_confirmation');
|
|
24
|
-
|
|
25
|
-
var _pane_separator = require('../../core/pane_separator');
|
|
26
|
-
|
|
27
|
-
var _pane_separator2 = _interopRequireDefault(_pane_separator);
|
|
28
|
-
|
|
29
|
-
var _index = require('../../core/index');
|
|
30
|
-
|
|
31
|
-
var l = _interopRequireWildcard(_index);
|
|
32
|
-
|
|
33
|
-
var _index2 = require('../../field/index');
|
|
34
|
-
|
|
35
|
-
var _index3 = require('../../connection/passwordless/index');
|
|
36
|
-
|
|
37
|
-
var _sign_up_terms = require('../../connection/database/sign_up_terms');
|
|
38
|
-
|
|
39
|
-
var _sign_up_terms2 = _interopRequireDefault(_sign_up_terms);
|
|
40
|
-
|
|
41
|
-
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; } }
|
|
42
|
-
|
|
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("../../core/screen"));
|
|
10
|
+
var _actions = require("../../connection/passwordless/actions");
|
|
11
|
+
var _phone_number_pane = _interopRequireDefault(require("../../field/phone-number/phone_number_pane"));
|
|
12
|
+
var _social_buttons_pane = _interopRequireDefault(require("../../field/social/social_buttons_pane"));
|
|
13
|
+
var _signed_in_confirmation = require("../../core/signed_in_confirmation");
|
|
14
|
+
var _pane_separator = _interopRequireDefault(require("../../core/pane_separator"));
|
|
15
|
+
var l = _interopRequireWildcard(require("../../core/index"));
|
|
16
|
+
var _index2 = require("../../field/index");
|
|
17
|
+
var _index3 = require("../../connection/passwordless/index");
|
|
18
|
+
var _sign_up_terms = _interopRequireDefault(require("../../connection/database/sign_up_terms"));
|
|
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; }
|
|
43
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
44
|
-
|
|
45
22
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
46
|
-
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
function
|
|
50
|
-
|
|
23
|
+
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); } }
|
|
24
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
26
|
+
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); }
|
|
27
|
+
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); }
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
+
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); }; }
|
|
30
|
+
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); }
|
|
31
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
32
|
+
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; } }
|
|
33
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
51
34
|
var Component = function Component(_ref) {
|
|
52
35
|
var i18n = _ref.i18n,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var social = l.hasSomeConnections(model, 'social') ? _react2.default.createElement(_social_buttons_pane2.default, {
|
|
36
|
+
model = _ref.model;
|
|
37
|
+
var social = l.hasSomeConnections(model, 'social') ? /*#__PURE__*/_react.default.createElement(_social_buttons_pane.default, {
|
|
56
38
|
instructions: i18n.html('socialLoginInstructions'),
|
|
57
39
|
labelFn: i18n.str,
|
|
58
40
|
lock: model,
|
|
59
41
|
signUp: true
|
|
60
42
|
}) : null;
|
|
61
|
-
|
|
62
43
|
var phoneNumberInstructionsI18nKey = social ? 'passwordlessSMSAlternativeInstructions' : 'passwordlessSMSInstructions';
|
|
63
|
-
|
|
64
|
-
var phoneNumber = l.hasSomeConnections(model, 'passwordless', 'sms') ? _react2.default.createElement(_phone_number_pane2.default, {
|
|
44
|
+
var phoneNumber = l.hasSomeConnections(model, 'passwordless', 'sms') ? /*#__PURE__*/_react.default.createElement(_phone_number_pane.default, {
|
|
65
45
|
instructions: i18n.html(phoneNumberInstructionsI18nKey),
|
|
66
46
|
lock: model,
|
|
67
47
|
placeholder: i18n.str('phoneNumberInputPlaceholder'),
|
|
68
48
|
invalidHint: i18n.str('phoneNumberInputInvalidHint')
|
|
69
49
|
}) : null;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return _react2.default.createElement(
|
|
74
|
-
'div',
|
|
75
|
-
null,
|
|
76
|
-
social,
|
|
77
|
-
separator,
|
|
78
|
-
phoneNumber
|
|
79
|
-
);
|
|
50
|
+
var separator = social && phoneNumber ? /*#__PURE__*/_react.default.createElement(_pane_separator.default, null) : null;
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement("div", null, social, separator, phoneNumber);
|
|
80
52
|
};
|
|
81
|
-
|
|
82
|
-
var AskSocialNetworkOrPhoneNumber = function (_Screen) {
|
|
53
|
+
var AskSocialNetworkOrPhoneNumber = /*#__PURE__*/function (_Screen) {
|
|
83
54
|
_inherits(AskSocialNetworkOrPhoneNumber, _Screen);
|
|
84
|
-
|
|
55
|
+
var _super = _createSuper(AskSocialNetworkOrPhoneNumber);
|
|
85
56
|
function AskSocialNetworkOrPhoneNumber() {
|
|
86
57
|
_classCallCheck(this, AskSocialNetworkOrPhoneNumber);
|
|
87
|
-
|
|
88
|
-
return _possibleConstructorReturn(this, _Screen.call(this, 'socialOrPhoneNumber'));
|
|
58
|
+
return _super.call(this, 'socialOrPhoneNumber');
|
|
89
59
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
{
|
|
60
|
+
_createClass(AskSocialNetworkOrPhoneNumber, [{
|
|
61
|
+
key: "submitHandler",
|
|
62
|
+
value: function submitHandler(m) {
|
|
63
|
+
return l.hasSomeConnections(m, 'passwordless', 'sms') ? _actions.sendSMS : null;
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
key: "renderAuxiliaryPane",
|
|
67
|
+
value: function renderAuxiliaryPane(lock) {
|
|
68
|
+
return (0, _signed_in_confirmation.renderSignedInConfirmation)(lock) || (0, _index2.renderOptionSelection)(lock);
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
key: "render",
|
|
72
|
+
value: function render() {
|
|
73
|
+
return Component;
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
key: "isSubmitDisabled",
|
|
77
|
+
value: function isSubmitDisabled(m) {
|
|
78
|
+
return !(0, _index3.termsAccepted)(m);
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
key: "renderTerms",
|
|
82
|
+
value: function renderTerms(m, terms) {
|
|
83
|
+
var checkHandler = (0, _index3.mustAcceptTerms)(m) ? function () {
|
|
84
|
+
return (0, _actions.toggleTermsAcceptance)(l.id(m));
|
|
85
|
+
} : undefined;
|
|
86
|
+
return terms && (0, _index3.showTerms)(m) ? /*#__PURE__*/_react.default.createElement(_sign_up_terms.default, {
|
|
114
87
|
showCheckbox: (0, _index3.mustAcceptTerms)(m),
|
|
115
88
|
checkHandler: checkHandler,
|
|
116
89
|
checked: (0, _index3.termsAccepted)(m)
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
};
|
|
121
|
-
|
|
90
|
+
}, terms) : null;
|
|
91
|
+
}
|
|
92
|
+
}]);
|
|
122
93
|
return AskSocialNetworkOrPhoneNumber;
|
|
123
|
-
}(
|
|
124
|
-
|
|
94
|
+
}(_screen.default);
|
|
125
95
|
exports.default = AskSocialNetworkOrPhoneNumber;
|
|
@@ -1,62 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
var _ask_vcode = require('../connection/passwordless/ask_vcode');
|
|
24
|
-
|
|
25
|
-
var _ask_vcode2 = _interopRequireDefault(_ask_vcode);
|
|
26
|
-
|
|
27
|
-
var _last_login_screen = require('../core/sso/last_login_screen');
|
|
28
|
-
|
|
29
|
-
var _last_login_screen2 = _interopRequireDefault(_last_login_screen);
|
|
30
|
-
|
|
31
|
-
var _index2 = require('../connection/passwordless/index');
|
|
32
|
-
|
|
33
|
-
var _sync = require('../sync');
|
|
34
|
-
|
|
35
|
-
var _index3 = require('../core/index');
|
|
36
|
-
|
|
37
|
-
var l = _interopRequireWildcard(_index3);
|
|
38
|
-
|
|
39
|
-
var _quick_auth = require('../quick_auth');
|
|
40
|
-
|
|
41
|
-
var _index4 = require('../core/sso/index');
|
|
42
|
-
|
|
43
|
-
var sso = _interopRequireWildcard(_index4);
|
|
44
|
-
|
|
45
|
-
var _email = require('../field/email');
|
|
46
|
-
|
|
47
|
-
var _phone_number = require('../field/phone_number');
|
|
48
|
-
|
|
49
|
-
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; } }
|
|
50
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _index = require("../store/index");
|
|
8
|
+
var _error_screen = _interopRequireDefault(require("../core/error_screen"));
|
|
9
|
+
var _loading_screen = _interopRequireDefault(require("../core/loading_screen"));
|
|
10
|
+
var _social_or_email_login_screen = _interopRequireDefault(require("./passwordless/social_or_email_login_screen"));
|
|
11
|
+
var _social_or_phone_number_login_screen = _interopRequireDefault(require("./passwordless/social_or_phone_number_login_screen"));
|
|
12
|
+
var _ask_vcode = _interopRequireDefault(require("../connection/passwordless/ask_vcode"));
|
|
13
|
+
var _last_login_screen = _interopRequireDefault(require("../core/sso/last_login_screen"));
|
|
14
|
+
var _index2 = require("../connection/passwordless/index");
|
|
15
|
+
var _sync = require("../sync");
|
|
16
|
+
var l = _interopRequireWildcard(require("../core/index"));
|
|
17
|
+
var _quick_auth = require("../quick_auth");
|
|
18
|
+
var sso = _interopRequireWildcard(require("../core/sso/index"));
|
|
19
|
+
var _email = require("../field/email");
|
|
20
|
+
var _phone_number = require("../field/phone_number");
|
|
21
|
+
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); }
|
|
22
|
+
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; }
|
|
51
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
52
|
-
|
|
24
|
+
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); }
|
|
53
25
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
54
|
-
|
|
26
|
+
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); } }
|
|
27
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
28
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
29
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
55
30
|
var setPrefill = function setPrefill(m) {
|
|
56
31
|
var _l$prefill$toJS = l.prefill(m).toJS(),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
32
|
+
email = _l$prefill$toJS.email,
|
|
33
|
+
phoneNumber = _l$prefill$toJS.phoneNumber;
|
|
60
34
|
if (typeof email === 'string') {
|
|
61
35
|
m = (0, _email.setEmail)(m, email);
|
|
62
36
|
}
|
|
@@ -65,67 +39,64 @@ var setPrefill = function setPrefill(m) {
|
|
|
65
39
|
}
|
|
66
40
|
return m;
|
|
67
41
|
};
|
|
68
|
-
|
|
69
|
-
var Passwordless = function () {
|
|
42
|
+
var Passwordless = /*#__PURE__*/function () {
|
|
70
43
|
function Passwordless() {
|
|
71
44
|
_classCallCheck(this, Passwordless);
|
|
72
45
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
Passwordless.prototype.didReceiveClientSettings = function didReceiveClientSettings(m) {
|
|
81
|
-
var anySocialConnection = l.hasSomeConnections(m, 'social');
|
|
82
|
-
var anyPasswordlessConnection = l.hasSomeConnections(m, 'passwordless');
|
|
83
|
-
|
|
84
|
-
if (!anySocialConnection && !anyPasswordlessConnection) {
|
|
85
|
-
var error = new Error('At least one email, sms or social connection needs to be available.');
|
|
86
|
-
error.code = 'no_connection';
|
|
87
|
-
m = l.stop(m, error);
|
|
88
|
-
}
|
|
89
|
-
m = setPrefill(m);
|
|
90
|
-
|
|
91
|
-
return m;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
Passwordless.prototype.render = function render(m) {
|
|
95
|
-
//if there's an error, we should show the error screen no matter what.
|
|
96
|
-
if (l.hasStopped(m)) {
|
|
97
|
-
return new _error_screen2.default();
|
|
46
|
+
_createClass(Passwordless, [{
|
|
47
|
+
key: "didInitialize",
|
|
48
|
+
value: function didInitialize(m, opts) {
|
|
49
|
+
m = (0, _index2.initPasswordless)(m, opts);
|
|
50
|
+
return m;
|
|
98
51
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
52
|
+
}, {
|
|
53
|
+
key: "didReceiveClientSettings",
|
|
54
|
+
value: function didReceiveClientSettings(m) {
|
|
55
|
+
var anySocialConnection = l.hasSomeConnections(m, 'social');
|
|
56
|
+
var anyPasswordlessConnection = l.hasSomeConnections(m, 'passwordless');
|
|
57
|
+
if (!anySocialConnection && !anyPasswordlessConnection) {
|
|
58
|
+
var error = new Error('At least one email, sms or social connection needs to be available.');
|
|
59
|
+
error.code = 'no_connection';
|
|
60
|
+
m = l.stop(m, error);
|
|
61
|
+
}
|
|
62
|
+
m = setPrefill(m);
|
|
63
|
+
return m;
|
|
104
64
|
}
|
|
65
|
+
}, {
|
|
66
|
+
key: "render",
|
|
67
|
+
value: function render(m) {
|
|
68
|
+
//if there's an error, we should show the error screen no matter what.
|
|
69
|
+
if (l.hasStopped(m)) {
|
|
70
|
+
return new _error_screen.default();
|
|
71
|
+
}
|
|
105
72
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
73
|
+
// TODO: remove the detail about the loading pane being pinned,
|
|
74
|
+
// sticky screens should be handled at the box module.
|
|
75
|
+
if (!(0, _sync.isDone)(m) || m.get('isLoadingPanePinned')) {
|
|
76
|
+
return new _loading_screen.default();
|
|
77
|
+
}
|
|
78
|
+
if (!(0, _quick_auth.hasSkippedQuickAuth)(m)) {
|
|
79
|
+
if (l.ui.rememberLastLogin(m)) {
|
|
80
|
+
var lastUsedConnection = sso.lastUsedConnection(m);
|
|
81
|
+
var lastUsedUsername = sso.lastUsedUsername(m);
|
|
82
|
+
if (lastUsedConnection && (0, _sync.isSuccess)(m, 'sso') && l.hasConnection(m, lastUsedConnection.get('name')) && ['passwordless', 'social'].indexOf(l.findConnection(m, lastUsedConnection.get('name')).get('type')) >= 0 //if connection.type is either passwordless or social
|
|
83
|
+
) {
|
|
112
84
|
var conn = l.findConnection(m, lastUsedConnection.get('name'));
|
|
113
85
|
var connectionType = conn.get('type');
|
|
114
86
|
if (connectionType === 'passwordless' || connectionType === 'social') {
|
|
115
|
-
return new
|
|
87
|
+
return new _last_login_screen.default();
|
|
116
88
|
}
|
|
117
89
|
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if ((0, _index2.isEmail)(m)) {
|
|
93
|
+
return (0, _index2.isSendLink)(m) || !(0, _index2.passwordlessStarted)(m) ? new _social_or_email_login_screen.default() : new _ask_vcode.default();
|
|
94
|
+
} else {
|
|
95
|
+
return (0, _index2.passwordlessStarted)(m) ? new _ask_vcode.default() : new _social_or_phone_number_login_screen.default();
|
|
118
96
|
}
|
|
119
97
|
}
|
|
120
|
-
|
|
121
|
-
if ((0, _index2.isEmail)(m)) {
|
|
122
|
-
return (0, _index2.isSendLink)(m) || !(0, _index2.passwordlessStarted)(m) ? new _social_or_email_login_screen2.default() : new _ask_vcode2.default();
|
|
123
|
-
} else {
|
|
124
|
-
return (0, _index2.passwordlessStarted)(m) ? new _ask_vcode2.default() : new _social_or_phone_number_login_screen2.default();
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
|
|
98
|
+
}]);
|
|
128
99
|
return Passwordless;
|
|
129
100
|
}();
|
|
130
|
-
|
|
131
|
-
exports.default =
|
|
101
|
+
var _default = new Passwordless();
|
|
102
|
+
exports.default = _default;
|
package/lib/field/actions.js
CHANGED
|
@@ -1,38 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.cancelOptionSelection = cancelOptionSelection;
|
|
4
7
|
exports.changeField = changeField;
|
|
5
|
-
exports.startOptionSelection = startOptionSelection;
|
|
6
8
|
exports.selectOption = selectOption;
|
|
7
|
-
exports.
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var _index = require('../store/index');
|
|
12
|
-
|
|
13
|
-
var _index2 = require('./index');
|
|
14
|
-
|
|
9
|
+
exports.startOptionSelection = startOptionSelection;
|
|
10
|
+
var _immutable = require("immutable");
|
|
11
|
+
var _index = require("../store/index");
|
|
12
|
+
var _index2 = require("./index");
|
|
15
13
|
function changeField(id, name, value, validationFn) {
|
|
16
|
-
for (var _len = arguments.length, validationExtraArgs = Array(_len > 4 ? _len - 4 : 0), _key = 4; _key < _len; _key++) {
|
|
14
|
+
for (var _len = arguments.length, validationExtraArgs = new Array(_len > 4 ? _len - 4 : 0), _key = 4; _key < _len; _key++) {
|
|
17
15
|
validationExtraArgs[_key - 4] = arguments[_key];
|
|
18
16
|
}
|
|
19
|
-
|
|
20
|
-
_index.swap.apply(undefined, [_index.updateEntity, 'lock', id, _index2.setField, name, value, validationFn].concat(validationExtraArgs));
|
|
17
|
+
_index.swap.apply(void 0, [_index.updateEntity, 'lock', id, _index2.setField, name, value, validationFn].concat(validationExtraArgs));
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
function startOptionSelection(id, name, iconUrl, icon) {
|
|
24
20
|
// TODO: should be transient
|
|
25
21
|
(0, _index.swap)(_index.updateEntity, 'lock', id, function (m) {
|
|
26
22
|
return m.setIn(['field', 'selecting', 'name'], name).setIn(['field', 'selecting', 'iconUrl'], iconUrl).setIn(['field', 'selecting', 'icon'], icon);
|
|
27
23
|
});
|
|
28
24
|
}
|
|
29
|
-
|
|
30
25
|
function selectOption(id, name, option) {
|
|
31
26
|
(0, _index.swap)(_index.updateEntity, 'lock', id, function (m) {
|
|
32
27
|
return (0, _index2.setOptionField)(m.deleteIn(['field', 'selecting']), name, option);
|
|
33
28
|
});
|
|
34
29
|
}
|
|
35
|
-
|
|
36
30
|
function cancelOptionSelection(id) {
|
|
37
31
|
(0, _index.swap)(_index.updateEntity, 'lock', id, function (m) {
|
|
38
32
|
return m.deleteIn(['field', 'selecting']);
|