auth0-lock 11.34.1 → 12.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +1 -0
- package/.circleci/config.yml +4 -2
- package/.eslintrc.json +5 -5
- package/.github/workflows/codeql.yml +41 -0
- package/.shiprc +4 -5
- package/CHANGELOG.md +32 -0
- package/EXAMPLES.md +626 -0
- package/README.md +77 -649
- package/karma.conf.js +1 -1
- package/lib/CSSCore.js +1 -4
- package/lib/__tests__/auth_button.js +12 -22
- package/lib/__tests__/connection/database/actions.js +48 -49
- package/lib/__tests__/connection/database/index.js +22 -28
- package/lib/__tests__/connection/database/login_pane.js +20 -41
- package/lib/__tests__/connection/database/password_reset_confirmation.js +19 -26
- package/lib/__tests__/connection/database/reset_password.js +17 -39
- package/lib/__tests__/connection/database/signed_up_confirmation.js +19 -26
- package/lib/__tests__/connection/enterprise/actions.js +22 -47
- package/lib/__tests__/connection/enterprise/hrd_pane.js +16 -33
- package/lib/__tests__/connection/enterprise/hrd_screen.js +26 -40
- package/lib/__tests__/connection/enterprise/quick_auth_screen.js +27 -68
- package/lib/__tests__/connection/passwordless/ask_vcode.js +29 -51
- package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +19 -26
- package/lib/__tests__/connection/passwordless/passwordless.js +35 -97
- package/lib/__tests__/core/actions.js +23 -46
- package/lib/__tests__/core/client/index.js +10 -13
- package/lib/__tests__/core/index.js +46 -94
- package/lib/__tests__/core/remote_data.js +14 -20
- package/lib/__tests__/core/signed_in_confirmation.js +19 -26
- package/lib/__tests__/core/sso/last_login_screen.js +27 -50
- package/lib/__tests__/core/tenant.js +10 -12
- package/lib/__tests__/core/web_api/helper.js +6 -14
- package/lib/__tests__/core/web_api/p2_api.js +38 -33
- package/lib/__tests__/core/web_api.js +37 -33
- package/lib/__tests__/engine/classic/login.js +20 -41
- package/lib/__tests__/engine/classic/mfa_login_screen.js +6 -19
- package/lib/__tests__/engine/classic/sign_up_pane.js +33 -55
- package/lib/__tests__/engine/classic/sign_up_screen.js +18 -45
- package/lib/__tests__/engine/classic.js +13 -6
- package/lib/__tests__/engine/passwordless.js +2 -5
- package/lib/__tests__/field/captcha/recaptcha_enterprise.js +27 -27
- package/lib/__tests__/field/captcha/recaptchav2.js +27 -27
- package/lib/__tests__/field/captcha.js +39 -51
- package/lib/__tests__/field/custom_input.js +23 -47
- package/lib/__tests__/field/email.js +2 -3
- package/lib/__tests__/field/email_pane.js +25 -48
- package/lib/__tests__/field/field.js +9 -13
- package/lib/__tests__/field/login_pane.js +30 -34
- package/lib/__tests__/field/mfa_code_pane.js +13 -28
- package/lib/__tests__/field/option_selection_pane.js +7 -25
- package/lib/__tests__/field/password.js +6 -12
- package/lib/__tests__/field/password_pane.js +29 -46
- package/lib/__tests__/field/phone_number_pane.js +18 -41
- package/lib/__tests__/field/social_buttons_pane.js +30 -47
- package/lib/__tests__/field/username.js +27 -48
- package/lib/__tests__/field/username_pane.js +30 -47
- package/lib/__tests__/field/vcode.js +5 -13
- package/lib/__tests__/field/vcode_pane.js +20 -44
- package/lib/__tests__/i18n.js +28 -53
- package/lib/__tests__/quick-auth/actions.js +4 -27
- package/lib/__tests__/setup-tests.js +7 -9
- package/lib/__tests__/testUtils.js +41 -58
- package/lib/__tests__/ui/box/chrome.js +24 -49
- package/lib/__tests__/ui/box/confirmation_pane.js +19 -36
- package/lib/__tests__/ui/box/container.js +21 -46
- package/lib/__tests__/ui/box/global_message.js +60 -37
- package/lib/__tests__/ui/input/email_input.js +6 -17
- package/lib/__tests__/ui/input/input_wrap.js +6 -19
- package/lib/__tests__/ui/input/password/password_strength.js +13 -15
- package/lib/__tests__/ui/input/password_input.js +22 -27
- package/lib/__tests__/utils/format.js +10 -17
- package/lib/__tests__/utils/url_utils.js +2 -5
- package/lib/avatar/gravatar_provider.js +13 -28
- package/lib/avatar.js +22 -41
- package/lib/browser.js +372 -23
- package/lib/connection/captcha.js +14 -32
- package/lib/connection/database/actions.js +39 -108
- package/lib/connection/database/index.js +90 -191
- package/lib/connection/database/login_pane.js +107 -147
- package/lib/connection/database/login_sign_up_tabs.js +106 -125
- package/lib/connection/database/mfa_pane.js +50 -69
- package/lib/connection/database/password_reset_confirmation.js +51 -73
- package/lib/connection/database/reset_password.js +116 -132
- package/lib/connection/database/reset_password_pane.js +45 -56
- package/lib/connection/database/sign_up_terms.js +17 -23
- package/lib/connection/database/signed_up_confirmation.js +52 -75
- package/lib/connection/enterprise/actions.js +23 -52
- package/lib/connection/enterprise/hrd_pane.js +60 -76
- package/lib/connection/enterprise/hrd_screen.js +60 -75
- package/lib/connection/enterprise/kerberos_screen.js +46 -60
- package/lib/connection/enterprise/quick_auth_screen.js +46 -64
- package/lib/connection/enterprise/single_sign_on_notice.js +14 -26
- package/lib/connection/enterprise.js +51 -84
- package/lib/connection/passwordless/actions.js +29 -62
- package/lib/connection/passwordless/ask_vcode.js +53 -60
- package/lib/connection/passwordless/email_sent_confirmation.js +129 -179
- package/lib/connection/passwordless/index.js +36 -68
- package/lib/connection/social/index.js +12 -15
- package/lib/core/actions.js +33 -85
- package/lib/core/client/index.js +38 -58
- package/lib/core/client/settings.js +12 -20
- package/lib/core/error_screen.js +38 -52
- package/lib/core/index.js +152 -301
- package/lib/core/loading_screen.js +61 -71
- package/lib/core/pane_separator.js +10 -10
- package/lib/core/remote_data.js +28 -48
- package/lib/core/screen.js +85 -79
- package/lib/core/signed_in_confirmation.js +51 -73
- package/lib/core/sso/data.js +9 -17
- package/lib/core/sso/index.js +5 -6
- package/lib/core/sso/last_login_screen.js +46 -63
- package/lib/core/tenant/index.js +37 -59
- package/lib/core/tenant/settings.js +11 -15
- package/lib/core/web_api/helper.js +24 -30
- package/lib/core/web_api/p2_api.js +156 -165
- package/lib/core/web_api.js +101 -90
- package/lib/core.js +126 -160
- package/lib/engine/classic/login.js +92 -144
- package/lib/engine/classic/mfa_login_screen.js +61 -67
- package/lib/engine/classic/sign_up_pane.js +89 -123
- package/lib/engine/classic/sign_up_screen.js +112 -158
- package/lib/engine/classic.js +122 -183
- package/lib/engine/passwordless/social_or_email_login_screen.js +71 -106
- package/lib/engine/passwordless/social_or_phone_number_login_screen.js +70 -100
- package/lib/engine/passwordless.js +75 -104
- package/lib/field/actions.js +11 -17
- package/lib/field/captcha/captcha_pane.js +82 -102
- package/lib/field/captcha/recaptcha.js +140 -145
- package/lib/field/captcha.js +7 -10
- package/lib/field/custom_input.js +37 -50
- package/lib/field/email/email_pane.js +90 -109
- package/lib/field/email.js +17 -35
- package/lib/field/index.js +51 -88
- package/lib/field/mfa-code/mfa_code_pane.js +57 -71
- package/lib/field/mfa_code.js +15 -21
- package/lib/field/option_selection_pane.js +16 -22
- package/lib/field/password/password_pane.js +79 -91
- package/lib/field/password.js +8 -14
- package/lib/field/phone-number/locations.js +7 -3
- package/lib/field/phone-number/phone_number_pane.js +87 -124
- package/lib/field/phone_number.js +16 -30
- package/lib/field/social/event.js +9 -12
- package/lib/field/social/social_buttons_pane.js +93 -121
- package/lib/field/username/username_pane.js +105 -123
- package/lib/field/username.js +16 -26
- package/lib/field/vcode/vcode_pane.js +67 -93
- package/lib/field/vcode.js +5 -5
- package/lib/i18n/af.js +7 -4
- package/lib/i18n/ar.js +7 -4
- package/lib/i18n/az.js +7 -4
- package/lib/i18n/bg.js +7 -4
- package/lib/i18n/ca.js +7 -4
- package/lib/i18n/cs.js +7 -4
- package/lib/i18n/da.js +7 -4
- package/lib/i18n/de.js +7 -3
- package/lib/i18n/el.js +7 -4
- package/lib/i18n/en.js +9 -4
- package/lib/i18n/es.js +7 -3
- package/lib/i18n/et.js +7 -4
- package/lib/i18n/fa.js +7 -4
- package/lib/i18n/fi.js +7 -4
- package/lib/i18n/fr.js +7 -4
- package/lib/i18n/he.js +7 -4
- package/lib/i18n/hr.js +7 -4
- package/lib/i18n/hu.js +7 -4
- package/lib/i18n/id.js +7 -4
- package/lib/i18n/it.js +7 -3
- package/lib/i18n/ja.js +7 -4
- package/lib/i18n/ko.js +7 -4
- package/lib/i18n/lt.js +7 -4
- package/lib/i18n/lv.js +7 -4
- package/lib/i18n/ms.js +7 -4
- package/lib/i18n/nb.js +7 -4
- package/lib/i18n/nl.js +7 -4
- package/lib/i18n/nn.js +7 -4
- package/lib/i18n/no.js +7 -4
- package/lib/i18n/pl.js +7 -4
- package/lib/i18n/pt-br.js +7 -3
- package/lib/i18n/pt.js +7 -4
- package/lib/i18n/ro.js +7 -4
- package/lib/i18n/ru.js +7 -4
- package/lib/i18n/sk.js +7 -4
- package/lib/i18n/sl.js +7 -4
- package/lib/i18n/sr.js +7 -4
- package/lib/i18n/sv.js +7 -4
- package/lib/i18n/tr.js +7 -4
- package/lib/i18n/ua.js +7 -4
- package/lib/i18n/uk.js +7 -4
- package/lib/i18n/vi.js +7 -4
- package/lib/i18n/zh-tw.js +7 -4
- package/lib/i18n/zh.js +7 -4
- package/lib/i18n.js +38 -75
- package/lib/index.js +14 -17
- package/lib/lock.js +29 -32
- package/lib/passwordless.js +29 -31
- package/lib/quick-auth/actions.js +19 -26
- package/lib/quick_auth.js +8 -10
- package/lib/sanitizer.js +5 -5
- package/lib/store/index.js +22 -42
- package/lib/sync.js +21 -42
- package/lib/ui/box/button.js +85 -105
- package/lib/ui/box/chrome.js +463 -548
- package/lib/ui/box/confirmation_pane.js +34 -48
- package/lib/ui/box/container.js +305 -339
- package/lib/ui/box/global_message.js +51 -60
- package/lib/ui/box/header.js +155 -177
- package/lib/ui/box/multisize_slide.js +233 -229
- package/lib/ui/box/success_pane.js +34 -37
- package/lib/ui/box.js +88 -93
- package/lib/ui/button/auth_button.js +44 -51
- package/lib/ui/input/captcha_input.js +162 -181
- package/lib/ui/input/checkbox_input.js +57 -59
- package/lib/ui/input/email_input.js +117 -124
- package/lib/ui/input/input_wrap.js +65 -80
- package/lib/ui/input/location_input.js +130 -150
- package/lib/ui/input/mfa_code_input.js +98 -98
- package/lib/ui/input/password/password_strength.js +103 -127
- package/lib/ui/input/password_input.js +141 -147
- package/lib/ui/input/phone_number_input.js +101 -109
- package/lib/ui/input/select_input.js +120 -132
- package/lib/ui/input/text_input.js +89 -84
- package/lib/ui/input/username_input.js +109 -115
- package/lib/ui/input/vcode_input.js +110 -118
- package/lib/ui/list.js +224 -247
- package/lib/ui/pane/quick_auth_pane.js +55 -80
- package/lib/utils/atom.js +55 -48
- package/lib/utils/cache.js +54 -43
- package/lib/utils/cdn_utils.js +17 -31
- package/lib/utils/createRef.js +3 -1
- package/lib/utils/data_utils.js +10 -16
- package/lib/utils/fn_utils.js +5 -4
- package/lib/utils/format.js +6 -8
- package/lib/utils/id_utils.js +4 -3
- package/lib/utils/jsonp_utils.js +20 -17
- package/lib/utils/media_utils.js +4 -2
- package/lib/utils/preload_utils.js +4 -3
- package/lib/utils/string_utils.js +4 -4
- package/lib/utils/url_utils.js +4 -3
- package/opslevel.yml +6 -0
- package/package.json +53 -38
- package/webpack.config.js +36 -3
package/lib/engine/classic.js
CHANGED
|
@@ -1,249 +1,188 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
exports.hasOnlyClassicConnections = hasOnlyClassicConnections;
|
|
4
8
|
exports.isSSOEnabled = isSSOEnabled;
|
|
5
9
|
exports.matchesEnterpriseConnection = matchesEnterpriseConnection;
|
|
6
10
|
exports.usernameStyle = usernameStyle;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
var sso = _interopRequireWildcard(_index3);
|
|
32
|
-
|
|
33
|
-
var _index4 = require('../connection/database/index');
|
|
34
|
-
|
|
35
|
-
var _enterprise = require('../connection/enterprise');
|
|
36
|
-
|
|
37
|
-
var _tenant = require('../core/tenant');
|
|
38
|
-
|
|
39
|
-
var _email = require('../field/email');
|
|
40
|
-
|
|
41
|
-
var _username = require('../field/username');
|
|
42
|
-
|
|
43
|
-
var _index5 = require('../core/index');
|
|
44
|
-
|
|
45
|
-
var l = _interopRequireWildcard(_index5);
|
|
46
|
-
|
|
47
|
-
var _kerberos_screen = require('../connection/enterprise/kerberos_screen');
|
|
48
|
-
|
|
49
|
-
var _kerberos_screen2 = _interopRequireDefault(_kerberos_screen);
|
|
50
|
-
|
|
51
|
-
var _hrd_screen = require('../connection/enterprise/hrd_screen');
|
|
52
|
-
|
|
53
|
-
var _hrd_screen2 = _interopRequireDefault(_hrd_screen);
|
|
54
|
-
|
|
55
|
-
var _quick_auth_screen = require('../connection/enterprise/quick_auth_screen');
|
|
56
|
-
|
|
57
|
-
var _quick_auth_screen2 = _interopRequireDefault(_quick_auth_screen);
|
|
58
|
-
|
|
59
|
-
var _quick_auth = require('../quick_auth');
|
|
60
|
-
|
|
61
|
-
var _loading_screen = require('../core/loading_screen');
|
|
62
|
-
|
|
63
|
-
var _loading_screen2 = _interopRequireDefault(_loading_screen);
|
|
64
|
-
|
|
65
|
-
var _error_screen = require('../core/error_screen');
|
|
66
|
-
|
|
67
|
-
var _error_screen2 = _interopRequireDefault(_error_screen);
|
|
68
|
-
|
|
69
|
-
var _last_login_screen = require('../core/sso/last_login_screen');
|
|
70
|
-
|
|
71
|
-
var _last_login_screen2 = _interopRequireDefault(_last_login_screen);
|
|
72
|
-
|
|
73
|
-
var _sync = require('../sync');
|
|
74
|
-
|
|
75
|
-
var _index6 = require('../field/index');
|
|
76
|
-
|
|
77
|
-
var _index7 = require('../store/index');
|
|
78
|
-
|
|
79
|
-
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; } }
|
|
80
|
-
|
|
11
|
+
var _index = _interopRequireDefault(require("../index"));
|
|
12
|
+
var _login = _interopRequireDefault(require("./classic/login"));
|
|
13
|
+
var _sign_up_screen = _interopRequireDefault(require("./classic/sign_up_screen"));
|
|
14
|
+
var _mfa_login_screen = _interopRequireDefault(require("./classic/mfa_login_screen"));
|
|
15
|
+
var _reset_password = _interopRequireDefault(require("../connection/database/reset_password"));
|
|
16
|
+
var sso = _interopRequireWildcard(require("../core/sso/index"));
|
|
17
|
+
var _index3 = require("../connection/database/index");
|
|
18
|
+
var _enterprise = require("../connection/enterprise");
|
|
19
|
+
var _tenant = require("../core/tenant");
|
|
20
|
+
var _email = require("../field/email");
|
|
21
|
+
var _username = require("../field/username");
|
|
22
|
+
var l = _interopRequireWildcard(require("../core/index"));
|
|
23
|
+
var _kerberos_screen = _interopRequireDefault(require("../connection/enterprise/kerberos_screen"));
|
|
24
|
+
var _hrd_screen = _interopRequireDefault(require("../connection/enterprise/hrd_screen"));
|
|
25
|
+
var _quick_auth_screen = _interopRequireDefault(require("../connection/enterprise/quick_auth_screen"));
|
|
26
|
+
var _quick_auth = require("../quick_auth");
|
|
27
|
+
var _loading_screen = _interopRequireDefault(require("../core/loading_screen"));
|
|
28
|
+
var _error_screen = _interopRequireDefault(require("../core/error_screen"));
|
|
29
|
+
var _last_login_screen = _interopRequireDefault(require("../core/sso/last_login_screen"));
|
|
30
|
+
var _sync = require("../sync");
|
|
31
|
+
var _index5 = require("../field/index");
|
|
32
|
+
var _index6 = require("../store/index");
|
|
33
|
+
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); }
|
|
34
|
+
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; }
|
|
81
35
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
82
|
-
|
|
36
|
+
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); }
|
|
83
37
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
84
|
-
|
|
38
|
+
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); } }
|
|
39
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
40
|
+
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; }
|
|
41
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
42
|
+
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); }
|
|
85
43
|
function isSSOEnabled(m, options) {
|
|
86
|
-
return matchesEnterpriseConnection(m, (0,
|
|
44
|
+
return matchesEnterpriseConnection(m, (0, _index3.databaseUsernameValue)(m, options));
|
|
87
45
|
}
|
|
88
|
-
|
|
89
46
|
function matchesEnterpriseConnection(m, usernameValue) {
|
|
90
47
|
return (0, _enterprise.isEnterpriseDomain)(m, usernameValue);
|
|
91
48
|
}
|
|
92
|
-
|
|
93
49
|
function usernameStyle(m) {
|
|
94
|
-
return (0,
|
|
50
|
+
return (0, _index3.authWithUsername)(m) && !(0, _enterprise.isADEnabled)(m) ? 'username' : 'email';
|
|
95
51
|
}
|
|
96
|
-
|
|
97
52
|
function hasOnlyClassicConnections(m) {
|
|
98
53
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
99
|
-
|
|
100
|
-
for (var _len = arguments.length, strategies = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
54
|
+
for (var _len = arguments.length, strategies = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
101
55
|
strategies[_key - 2] = arguments[_key];
|
|
102
56
|
}
|
|
103
|
-
|
|
104
57
|
return l.hasOnlyConnections.apply(l, [m, type].concat(strategies)) && !l.hasSomeConnections(m, 'passwordless');
|
|
105
58
|
}
|
|
106
|
-
|
|
107
59
|
function validateAllowedConnections(m) {
|
|
108
60
|
var anyDBConnection = l.hasSomeConnections(m, 'database');
|
|
109
61
|
var anySocialConnection = l.hasSomeConnections(m, 'social');
|
|
110
62
|
var anyEnterpriseConnection = l.hasSomeConnections(m, 'enterprise');
|
|
111
|
-
|
|
112
63
|
if (!anyDBConnection && !anySocialConnection && !anyEnterpriseConnection) {
|
|
113
64
|
var error = new Error('At least one database, enterprise or social connection needs to be available.');
|
|
114
65
|
error.code = 'no_connection';
|
|
115
66
|
m = l.stop(m, error);
|
|
116
|
-
} else if (!anyDBConnection && (0,
|
|
67
|
+
} else if (!anyDBConnection && (0, _index3.hasInitialScreen)(m, 'forgotPassword')) {
|
|
117
68
|
var _error = new Error('The `initialScreen` option was set to "forgotPassword" but no database connection is available.');
|
|
118
69
|
_error.code = 'unavailable_initial_screen';
|
|
119
70
|
m = l.stop(m, _error);
|
|
120
|
-
} else if (!anyDBConnection && !anySocialConnection && (0,
|
|
71
|
+
} else if (!anyDBConnection && !anySocialConnection && (0, _index3.hasInitialScreen)(m, 'signUp')) {
|
|
121
72
|
var _error2 = new Error('The `initialScreen` option was set to "signUp" but no database or social connection is available.');
|
|
122
73
|
_error2.code = 'unavailable_initial_screen';
|
|
123
74
|
m = l.stop(m, _error2);
|
|
124
75
|
}
|
|
125
|
-
|
|
126
76
|
if ((0, _tenant.defaultDirectoryName)(m) && !(0, _tenant.defaultDirectory)(m)) {
|
|
127
|
-
l.error(m,
|
|
77
|
+
l.error(m, "The account's default directory \"".concat((0, _tenant.defaultDirectoryName)(m), "\" is not enabled."));
|
|
128
78
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
l.warn(m, 'The provided default database connection "' + (0, _index4.defaultDatabaseConnectionName)(m) + '" is not enabled.');
|
|
79
|
+
if ((0, _index3.defaultDatabaseConnectionName)(m) && !(0, _index3.defaultDatabaseConnection)(m)) {
|
|
80
|
+
l.warn(m, "The provided default database connection \"".concat((0, _index3.defaultDatabaseConnectionName)(m), "\" is not enabled."));
|
|
132
81
|
}
|
|
133
|
-
|
|
134
82
|
if ((0, _enterprise.defaultEnterpriseConnectionName)(m) && !(0, _enterprise.defaultEnterpriseConnection)(m)) {
|
|
135
|
-
l.warn(m,
|
|
83
|
+
l.warn(m, "The provided default enterprise connection \"".concat((0, _enterprise.defaultEnterpriseConnectionName)(m), "\" is not enabled or does not allow email/password authentication."));
|
|
136
84
|
}
|
|
137
|
-
|
|
138
85
|
return m;
|
|
139
86
|
}
|
|
140
|
-
|
|
141
87
|
var setPrefill = function setPrefill(m) {
|
|
142
88
|
var _l$prefill$toJS = l.prefill(m).toJS(),
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
89
|
+
email = _l$prefill$toJS.email,
|
|
90
|
+
username = _l$prefill$toJS.username;
|
|
146
91
|
if (typeof email === 'string') m = (0, _email.setEmail)(m, email);
|
|
147
92
|
if (typeof username === 'string') m = (0, _username.setUsername)(m, username, 'username', false);
|
|
148
93
|
return m;
|
|
149
94
|
};
|
|
150
|
-
|
|
151
95
|
function createErrorScreen(m, stopError) {
|
|
152
96
|
setTimeout(function () {
|
|
153
|
-
(0,
|
|
97
|
+
(0, _index6.swap)(_index6.updateEntity, 'lock', l.id(m), l.stop, stopError);
|
|
154
98
|
}, 0);
|
|
155
|
-
|
|
156
|
-
return new _error_screen2.default();
|
|
99
|
+
return new _error_screen.default();
|
|
157
100
|
}
|
|
158
|
-
|
|
159
|
-
var Classic = function () {
|
|
101
|
+
var Classic = /*#__PURE__*/function () {
|
|
160
102
|
function Classic() {
|
|
161
103
|
_classCallCheck(this, Classic);
|
|
162
104
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
Classic.prototype.didReceiveClientSettings = function didReceiveClientSettings(m) {
|
|
172
|
-
m = validateAllowedConnections(m);
|
|
173
|
-
m = setPrefill(m);
|
|
174
|
-
return m;
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
Classic.prototype.willShow = function willShow(m, opts) {
|
|
178
|
-
m = (0, _index4.overrideDatabaseOptions)(m, opts);
|
|
179
|
-
m = (0, _index4.resolveAdditionalSignUpFields)(m);
|
|
180
|
-
if ((0, _sync.isSuccess)(m, 'client')) {
|
|
181
|
-
m = validateAllowedConnections(m);
|
|
105
|
+
_createClass(Classic, [{
|
|
106
|
+
key: "didInitialize",
|
|
107
|
+
value: function didInitialize(model, options) {
|
|
108
|
+
model = (0, _index3.initDatabase)(model, options);
|
|
109
|
+
model = (0, _enterprise.initEnterprise)(model, options);
|
|
110
|
+
return model;
|
|
182
111
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
return new _error_screen2.default();
|
|
112
|
+
}, {
|
|
113
|
+
key: "didReceiveClientSettings",
|
|
114
|
+
value: function didReceiveClientSettings(m) {
|
|
115
|
+
m = validateAllowedConnections(m);
|
|
116
|
+
m = setPrefill(m);
|
|
117
|
+
return m;
|
|
190
118
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
119
|
+
}, {
|
|
120
|
+
key: "willShow",
|
|
121
|
+
value: function willShow(m, opts) {
|
|
122
|
+
m = (0, _index3.overrideDatabaseOptions)(m, opts);
|
|
123
|
+
m = (0, _index3.resolveAdditionalSignUpFields)(m);
|
|
124
|
+
if ((0, _sync.isSuccess)(m, 'client')) {
|
|
125
|
+
m = validateAllowedConnections(m);
|
|
126
|
+
}
|
|
127
|
+
return m;
|
|
196
128
|
}
|
|
129
|
+
}, {
|
|
130
|
+
key: "render",
|
|
131
|
+
value: function render(m) {
|
|
132
|
+
//if there's an error, we should show the error screen no matter what.
|
|
133
|
+
if (l.hasStopped(m)) {
|
|
134
|
+
return new _error_screen.default();
|
|
135
|
+
}
|
|
197
136
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if (lastUsedConnection && (0, _sync.isSuccess)(m, 'sso') && l.hasConnection(m, lastUsedConnection.get('name')) && l.findConnection(m, lastUsedConnection.get('name')).get('type') !== 'passwordless') {
|
|
208
|
-
return new _last_login_screen2.default();
|
|
137
|
+
// TODO: remove the detail about the loading pane being pinned,
|
|
138
|
+
// sticky screens should be handled at the box module.
|
|
139
|
+
if (!(0, _sync.isDone)(m) || m.get('isLoadingPanePinned')) {
|
|
140
|
+
return new _loading_screen.default();
|
|
141
|
+
}
|
|
142
|
+
if ((0, _index3.hasScreen)(m, 'login')) {
|
|
143
|
+
if (!(0, _quick_auth.hasSkippedQuickAuth)(m) && (0, _index3.hasInitialScreen)(m, 'login')) {
|
|
144
|
+
if ((0, _enterprise.isInCorpNetwork)(m)) {
|
|
145
|
+
return new _kerberos_screen.default();
|
|
209
146
|
}
|
|
147
|
+
if (l.ui.rememberLastLogin(m)) {
|
|
148
|
+
var lastUsedConnection = sso.lastUsedConnection(m);
|
|
149
|
+
var lastUsedUsername = sso.lastUsedUsername(m);
|
|
150
|
+
if (lastUsedConnection && (0, _sync.isSuccess)(m, 'sso') && l.hasConnection(m, lastUsedConnection.get('name')) && l.findConnection(m, lastUsedConnection.get('name')).get('type') !== 'passwordless') {
|
|
151
|
+
return new _last_login_screen.default();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if ((0, _enterprise.quickAuthConnection)(m)) {
|
|
156
|
+
return new _quick_auth_screen.default();
|
|
157
|
+
}
|
|
158
|
+
if ((0, _enterprise.isHRDActive)(m)) {
|
|
159
|
+
return new _hrd_screen.default();
|
|
210
160
|
}
|
|
211
161
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
162
|
+
if (!(0, _index3.hasScreen)(m, 'login') && !(0, _index3.hasScreen)(m, 'signUp') && !(0, _index3.hasScreen)(m, 'forgotPassword')) {
|
|
163
|
+
var errorMessage = 'No available Screen. You have to allow at least one of those screens: `login`, `signUp`or `forgotPassword`.';
|
|
164
|
+
var noAvailableScreenError = new Error(errorMessage);
|
|
165
|
+
noAvailableScreenError.code = 'internal_error';
|
|
166
|
+
noAvailableScreenError.description = errorMessage;
|
|
167
|
+
return createErrorScreen(m, noAvailableScreenError);
|
|
215
168
|
}
|
|
216
|
-
|
|
217
|
-
if (
|
|
218
|
-
return new
|
|
169
|
+
var Screen = Classic.SCREENS[(0, _index3.getScreen)(m)];
|
|
170
|
+
if (Screen) {
|
|
171
|
+
return new Screen();
|
|
219
172
|
}
|
|
173
|
+
var noScreenError = new Error('Internal error');
|
|
174
|
+
noScreenError.code = 'internal_error';
|
|
175
|
+
noScreenError.description = "Couldn't find a screen \"".concat((0, _index3.getScreen)(m), "\"");
|
|
176
|
+
return createErrorScreen(m, noScreenError);
|
|
220
177
|
}
|
|
221
|
-
|
|
222
|
-
if (!(0, _index4.hasScreen)(m, 'login') && !(0, _index4.hasScreen)(m, 'signUp') && !(0, _index4.hasScreen)(m, 'forgotPassword')) {
|
|
223
|
-
var errorMessage = 'No available Screen. You have to allow at least one of those screens: `login`, `signUp`or `forgotPassword`.';
|
|
224
|
-
var noAvailableScreenError = new Error(errorMessage);
|
|
225
|
-
noAvailableScreenError.code = 'internal_error';
|
|
226
|
-
noAvailableScreenError.description = errorMessage;
|
|
227
|
-
return createErrorScreen(m, noAvailableScreenError);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
var Screen = Classic.SCREENS[(0, _index4.getScreen)(m)];
|
|
231
|
-
if (Screen) {
|
|
232
|
-
return new Screen();
|
|
233
|
-
}
|
|
234
|
-
var noScreenError = new Error('Internal error');
|
|
235
|
-
noScreenError.code = 'internal_error';
|
|
236
|
-
noScreenError.description = 'Couldn\'t find a screen "' + (0, _index4.getScreen)(m) + '"';
|
|
237
|
-
return createErrorScreen(m, noScreenError);
|
|
238
|
-
};
|
|
239
|
-
|
|
178
|
+
}]);
|
|
240
179
|
return Classic;
|
|
241
180
|
}();
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
exports.default =
|
|
181
|
+
_defineProperty(Classic, "SCREENS", {
|
|
182
|
+
login: _login.default,
|
|
183
|
+
forgotPassword: _reset_password.default,
|
|
184
|
+
signUp: _sign_up_screen.default,
|
|
185
|
+
mfaLogin: _mfa_login_screen.default
|
|
186
|
+
});
|
|
187
|
+
var _default = new Classic();
|
|
188
|
+
exports.default = _default;
|
|
@@ -1,65 +1,46 @@
|
|
|
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 _pane_separator = require('../../core/pane_separator');
|
|
22
|
-
|
|
23
|
-
var _pane_separator2 = _interopRequireDefault(_pane_separator);
|
|
24
|
-
|
|
25
|
-
var _index = require('../../connection/passwordless/index');
|
|
26
|
-
|
|
27
|
-
var _actions = require('../../connection/passwordless/actions');
|
|
28
|
-
|
|
29
|
-
var _email_sent_confirmation = require('../../connection/passwordless/email_sent_confirmation');
|
|
30
|
-
|
|
31
|
-
var _signed_in_confirmation = require('../../core/signed_in_confirmation');
|
|
32
|
-
|
|
33
|
-
var _index2 = require('../../core/index');
|
|
34
|
-
|
|
35
|
-
var l = _interopRequireWildcard(_index2);
|
|
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 _email_pane = _interopRequireDefault(require("../../field/email/email_pane"));
|
|
11
|
+
var _social_buttons_pane = _interopRequireDefault(require("../../field/social/social_buttons_pane"));
|
|
12
|
+
var _pane_separator = _interopRequireDefault(require("../../core/pane_separator"));
|
|
13
|
+
var _index = require("../../connection/passwordless/index");
|
|
14
|
+
var _actions = require("../../connection/passwordless/actions");
|
|
15
|
+
var _email_sent_confirmation = require("../../connection/passwordless/email_sent_confirmation");
|
|
16
|
+
var _signed_in_confirmation = require("../../core/signed_in_confirmation");
|
|
17
|
+
var l = _interopRequireWildcard(require("../../core/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
|
-
var email = l.hasSomeConnections(model, 'passwordless', 'email') ? _react2.default.createElement(_email_pane2.default, {
|
|
43
|
+
var email = l.hasSomeConnections(model, 'passwordless', 'email') ? /*#__PURE__*/_react.default.createElement(_email_pane.default, {
|
|
63
44
|
i18n: i18n,
|
|
64
45
|
lock: model,
|
|
65
46
|
placeholder: i18n.str('emailInputPlaceholder'),
|
|
@@ -72,67 +53,51 @@ var Component = function Component(_ref) {
|
|
|
72
53
|
//
|
|
73
54
|
// Maybe we can make new PasswordlessEmailPane component.
|
|
74
55
|
var emailInstructionsI18nKey = social ? 'passwordlessEmailAlternativeInstructions' : 'passwordlessEmailInstructions';
|
|
75
|
-
|
|
76
56
|
var headerText = i18n.html(emailInstructionsI18nKey) || null;
|
|
77
|
-
var header = email && headerText &&
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
headerText
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
var separator = social && email ? _react2.default.createElement(_pane_separator2.default, null) : null;
|
|
84
|
-
|
|
85
|
-
return _react2.default.createElement(
|
|
86
|
-
'div',
|
|
87
|
-
null,
|
|
88
|
-
social,
|
|
89
|
-
separator,
|
|
90
|
-
header,
|
|
91
|
-
email
|
|
92
|
-
);
|
|
57
|
+
var header = email && headerText && /*#__PURE__*/_react.default.createElement("p", null, headerText);
|
|
58
|
+
var separator = social && email ? /*#__PURE__*/_react.default.createElement(_pane_separator.default, null) : null;
|
|
59
|
+
return /*#__PURE__*/_react.default.createElement("div", null, social, separator, header, email);
|
|
93
60
|
};
|
|
94
|
-
|
|
95
|
-
var SocialOrEmailLoginScreen = function (_Screen) {
|
|
61
|
+
var SocialOrEmailLoginScreen = /*#__PURE__*/function (_Screen) {
|
|
96
62
|
_inherits(SocialOrEmailLoginScreen, _Screen);
|
|
97
|
-
|
|
63
|
+
var _super = _createSuper(SocialOrEmailLoginScreen);
|
|
98
64
|
function SocialOrEmailLoginScreen() {
|
|
99
65
|
_classCallCheck(this, SocialOrEmailLoginScreen);
|
|
100
|
-
|
|
101
|
-
return _possibleConstructorReturn(this, _Screen.call(this, 'socialOrEmail'));
|
|
66
|
+
return _super.call(this, 'socialOrEmail');
|
|
102
67
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
{
|
|
68
|
+
_createClass(SocialOrEmailLoginScreen, [{
|
|
69
|
+
key: "submitHandler",
|
|
70
|
+
value: function submitHandler(m) {
|
|
71
|
+
return l.hasSomeConnections(m, 'passwordless', 'email') ? _actions.requestPasswordlessEmail : null;
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
key: "renderAuxiliaryPane",
|
|
75
|
+
value: function renderAuxiliaryPane(lock) {
|
|
76
|
+
return (0, _email_sent_confirmation.renderEmailSentConfirmation)(lock) || (0, _signed_in_confirmation.renderSignedInConfirmation)(lock);
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
key: "render",
|
|
80
|
+
value: function render() {
|
|
81
|
+
return Component;
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
key: "isSubmitDisabled",
|
|
85
|
+
value: function isSubmitDisabled(m) {
|
|
86
|
+
return !(0, _index.termsAccepted)(m);
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
key: "renderTerms",
|
|
90
|
+
value: function renderTerms(m, terms) {
|
|
91
|
+
var checkHandler = (0, _index.mustAcceptTerms)(m) ? function () {
|
|
92
|
+
return (0, _actions.toggleTermsAcceptance)(l.id(m));
|
|
93
|
+
} : undefined;
|
|
94
|
+
return terms && (0, _index.showTerms)(m) ? /*#__PURE__*/_react.default.createElement(_sign_up_terms.default, {
|
|
127
95
|
showCheckbox: (0, _index.mustAcceptTerms)(m),
|
|
128
96
|
checkHandler: checkHandler,
|
|
129
97
|
checked: (0, _index.termsAccepted)(m)
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
};
|
|
134
|
-
|
|
98
|
+
}, terms) : null;
|
|
99
|
+
}
|
|
100
|
+
}]);
|
|
135
101
|
return SocialOrEmailLoginScreen;
|
|
136
|
-
}(
|
|
137
|
-
|
|
102
|
+
}(_screen.default);
|
|
138
103
|
exports.default = SocialOrEmailLoginScreen;
|