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,165 +1,125 @@
|
|
|
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 _password_pane2 = _interopRequireDefault(_password_pane);
|
|
24
|
-
|
|
25
|
-
var _actions = require('./actions');
|
|
26
|
-
|
|
27
|
-
var _captcha = require('../captcha');
|
|
28
|
-
|
|
29
|
-
var _index = require('./index');
|
|
30
|
-
|
|
31
|
-
var _index2 = require('../../core/index');
|
|
32
|
-
|
|
33
|
-
var l = _interopRequireWildcard(_index2);
|
|
34
|
-
|
|
35
|
-
var _captcha_pane = require('../../field/captcha/captcha_pane');
|
|
36
|
-
|
|
37
|
-
var _captcha_pane2 = _interopRequireDefault(_captcha_pane);
|
|
38
|
-
|
|
39
|
-
var _classic = require('../../engine/classic');
|
|
40
|
-
|
|
41
|
-
var _enterprise = require('../enterprise');
|
|
42
|
-
|
|
43
|
-
var _database = require('../database');
|
|
44
|
-
|
|
45
|
-
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; } }
|
|
46
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _email_pane = _interopRequireDefault(require("../../field/email/email_pane"));
|
|
10
|
+
var _username_pane = _interopRequireDefault(require("../../field/username/username_pane"));
|
|
11
|
+
var _password_pane = _interopRequireDefault(require("../../field/password/password_pane"));
|
|
12
|
+
var _actions = require("./actions");
|
|
13
|
+
var _captcha = require("../captcha");
|
|
14
|
+
var _index = require("./index");
|
|
15
|
+
var l = _interopRequireWildcard(require("../../core/index"));
|
|
16
|
+
var _captcha_pane = _interopRequireDefault(require("../../field/captcha/captcha_pane"));
|
|
17
|
+
var _classic = require("../../engine/classic");
|
|
18
|
+
var _enterprise = require("../enterprise");
|
|
19
|
+
var _database = require("../database");
|
|
20
|
+
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); }
|
|
21
|
+
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; }
|
|
47
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
48
|
-
|
|
23
|
+
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); }
|
|
49
24
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
50
|
-
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
-
|
|
25
|
+
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); } }
|
|
26
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
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); }
|
|
34
|
+
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; }
|
|
35
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
36
|
+
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); }
|
|
37
|
+
var LoginPane = /*#__PURE__*/function (_React$Component) {
|
|
56
38
|
_inherits(LoginPane, _React$Component);
|
|
57
|
-
|
|
39
|
+
var _super = _createSuper(LoginPane);
|
|
58
40
|
function LoginPane() {
|
|
59
|
-
var
|
|
60
|
-
|
|
41
|
+
var _this;
|
|
61
42
|
_classCallCheck(this, LoginPane);
|
|
62
|
-
|
|
63
|
-
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
43
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
64
44
|
args[_key] = arguments[_key];
|
|
65
45
|
}
|
|
66
|
-
|
|
67
|
-
|
|
46
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
47
|
+
_defineProperty(_assertThisInitialized(_this), "handleDontRememberPasswordClick", function (e) {
|
|
68
48
|
e.preventDefault();
|
|
69
49
|
(0, _actions.showResetPasswordActivity)(l.id(_this.props.lock));
|
|
70
|
-
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
LoginPane.prototype.render = function render() {
|
|
74
|
-
var _props = this.props,
|
|
75
|
-
emailInputPlaceholder = _props.emailInputPlaceholder,
|
|
76
|
-
forgotPasswordAction = _props.forgotPasswordAction,
|
|
77
|
-
i18n = _props.i18n,
|
|
78
|
-
instructions = _props.instructions,
|
|
79
|
-
lock = _props.lock,
|
|
80
|
-
passwordInputPlaceholder = _props.passwordInputPlaceholder,
|
|
81
|
-
showForgotPasswordLink = _props.showForgotPasswordLink,
|
|
82
|
-
showPassword = _props.showPassword,
|
|
83
|
-
usernameInputPlaceholder = _props.usernameInputPlaceholder,
|
|
84
|
-
usernameStyle = _props.usernameStyle;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var headerText = instructions || null;
|
|
88
|
-
var header = headerText && _react2.default.createElement(
|
|
89
|
-
'p',
|
|
90
|
-
null,
|
|
91
|
-
headerText
|
|
92
|
-
);
|
|
93
|
-
var resolver = l.connectionResolver(lock);
|
|
94
|
-
var sso = (0, _classic.isSSOEnabled)(lock);
|
|
95
|
-
|
|
96
|
-
// Should never validate format on login because of custom db connection and import mode.
|
|
97
|
-
// If a custom resolver is in use, always use UsernamePane without validating format,
|
|
98
|
-
// as the target connection (and this validation rules) could change by time the user hits 'submit'.
|
|
99
|
-
var fieldPane = usernameStyle === 'email' && resolver === undefined ? _react2.default.createElement(_email_pane2.default, {
|
|
100
|
-
i18n: i18n,
|
|
101
|
-
lock: lock,
|
|
102
|
-
forceInvalidVisibility: !showPassword,
|
|
103
|
-
placeholder: emailInputPlaceholder,
|
|
104
|
-
strictValidation: false
|
|
105
|
-
}) : _react2.default.createElement(_username_pane2.default, {
|
|
106
|
-
i18n: i18n,
|
|
107
|
-
lock: lock,
|
|
108
|
-
placeholder: usernameInputPlaceholder,
|
|
109
|
-
usernameStyle: usernameStyle,
|
|
110
|
-
validateFormat: false,
|
|
111
|
-
strictValidation: false
|
|
112
50
|
});
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
51
|
+
return _this;
|
|
52
|
+
}
|
|
53
|
+
_createClass(LoginPane, [{
|
|
54
|
+
key: "render",
|
|
55
|
+
value: function render() {
|
|
56
|
+
var _this$props = this.props,
|
|
57
|
+
emailInputPlaceholder = _this$props.emailInputPlaceholder,
|
|
58
|
+
forgotPasswordAction = _this$props.forgotPasswordAction,
|
|
59
|
+
i18n = _this$props.i18n,
|
|
60
|
+
instructions = _this$props.instructions,
|
|
61
|
+
lock = _this$props.lock,
|
|
62
|
+
passwordInputPlaceholder = _this$props.passwordInputPlaceholder,
|
|
63
|
+
showForgotPasswordLink = _this$props.showForgotPasswordLink,
|
|
64
|
+
showPassword = _this$props.showPassword,
|
|
65
|
+
usernameInputPlaceholder = _this$props.usernameInputPlaceholder,
|
|
66
|
+
usernameStyle = _this$props.usernameStyle;
|
|
67
|
+
var headerText = instructions || null;
|
|
68
|
+
var header = headerText && /*#__PURE__*/_react.default.createElement("p", null, headerText);
|
|
69
|
+
var resolver = l.connectionResolver(lock);
|
|
70
|
+
var sso = (0, _classic.isSSOEnabled)(lock);
|
|
71
|
+
|
|
72
|
+
// Should never validate format on login because of custom db connection and import mode.
|
|
73
|
+
// If a custom resolver is in use, always use UsernamePane without validating format,
|
|
74
|
+
// as the target connection (and this validation rules) could change by time the user hits 'submit'.
|
|
75
|
+
var fieldPane = usernameStyle === 'email' && resolver === undefined ? /*#__PURE__*/_react.default.createElement(_email_pane.default, {
|
|
76
|
+
i18n: i18n,
|
|
77
|
+
lock: lock,
|
|
78
|
+
forceInvalidVisibility: !showPassword,
|
|
79
|
+
placeholder: emailInputPlaceholder,
|
|
80
|
+
strictValidation: false
|
|
81
|
+
}) : /*#__PURE__*/_react.default.createElement(_username_pane.default, {
|
|
82
|
+
i18n: i18n,
|
|
83
|
+
lock: lock,
|
|
84
|
+
placeholder: usernameInputPlaceholder,
|
|
85
|
+
usernameStyle: usernameStyle,
|
|
86
|
+
validateFormat: false,
|
|
87
|
+
strictValidation: false
|
|
88
|
+
});
|
|
89
|
+
var captchaPane = l.captcha(lock) && l.captcha(lock).get('required') && ((0, _enterprise.isHRDDomain)(lock, (0, _database.databaseUsernameValue)(lock)) || !sso) ? /*#__PURE__*/_react.default.createElement(_captcha_pane.default, {
|
|
90
|
+
i18n: i18n,
|
|
91
|
+
lock: lock,
|
|
92
|
+
onReload: function onReload() {
|
|
93
|
+
return (0, _captcha.swapCaptcha)(l.id(lock), false);
|
|
94
|
+
}
|
|
95
|
+
}) : null;
|
|
96
|
+
var dontRememberPassword = showForgotPasswordLink && (0, _index.hasScreen)(lock, 'forgotPassword') ? /*#__PURE__*/_react.default.createElement("p", {
|
|
97
|
+
className: "auth0-lock-alternative"
|
|
98
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
99
|
+
className: "auth0-lock-alternative-link",
|
|
100
|
+
href: (0, _index.forgotPasswordLink)(lock, '#'),
|
|
101
|
+
onClick: (0, _index.forgotPasswordLink)(lock) ? undefined : this.handleDontRememberPasswordClick
|
|
102
|
+
}, forgotPasswordAction)) : null;
|
|
103
|
+
return /*#__PURE__*/_react.default.createElement("div", null, header, fieldPane, /*#__PURE__*/_react.default.createElement(_password_pane.default, {
|
|
138
104
|
i18n: i18n,
|
|
139
105
|
lock: lock,
|
|
140
106
|
placeholder: passwordInputPlaceholder,
|
|
141
107
|
hidden: !showPassword
|
|
142
|
-
}),
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
);
|
|
146
|
-
};
|
|
147
|
-
|
|
108
|
+
}), captchaPane, dontRememberPassword);
|
|
109
|
+
}
|
|
110
|
+
}]);
|
|
148
111
|
return LoginPane;
|
|
149
|
-
}(
|
|
150
|
-
|
|
112
|
+
}(_react.default.Component);
|
|
151
113
|
exports.default = LoginPane;
|
|
152
|
-
|
|
153
|
-
|
|
154
114
|
LoginPane.propTypes = {
|
|
155
|
-
emailInputPlaceholder:
|
|
156
|
-
forgotPasswordAction:
|
|
157
|
-
i18n:
|
|
158
|
-
instructions:
|
|
159
|
-
lock:
|
|
160
|
-
passwordInputPlaceholder:
|
|
161
|
-
showForgotPasswordLink:
|
|
162
|
-
showPassword:
|
|
163
|
-
usernameInputPlaceholder:
|
|
164
|
-
usernameStyle:
|
|
115
|
+
emailInputPlaceholder: _propTypes.default.string.isRequired,
|
|
116
|
+
forgotPasswordAction: _propTypes.default.string.isRequired,
|
|
117
|
+
i18n: _propTypes.default.object.isRequired,
|
|
118
|
+
instructions: _propTypes.default.any,
|
|
119
|
+
lock: _propTypes.default.object.isRequired,
|
|
120
|
+
passwordInputPlaceholder: _propTypes.default.string.isRequired,
|
|
121
|
+
showForgotPasswordLink: _propTypes.default.bool.isRequired,
|
|
122
|
+
showPassword: _propTypes.default.bool.isRequired,
|
|
123
|
+
usernameInputPlaceholder: _propTypes.default.string.isRequired,
|
|
124
|
+
usernameStyle: _propTypes.default.oneOf(['any', 'email', 'username'])
|
|
165
125
|
};
|
|
@@ -1,147 +1,128 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _react = require(
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var l = _interopRequireWildcard(_index);
|
|
18
|
-
|
|
19
|
-
var _index2 = require('./index');
|
|
20
|
-
|
|
21
|
-
var _actions2 = require('../../core/actions');
|
|
22
|
-
|
|
23
|
-
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; } }
|
|
24
|
-
|
|
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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _actions = require("./actions");
|
|
11
|
+
var l = _interopRequireWildcard(require("../../core/index"));
|
|
12
|
+
var _index2 = require("./index");
|
|
13
|
+
var _actions2 = require("../../core/actions");
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
25
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
-
|
|
17
|
+
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
18
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
28
|
-
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
|
|
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); }
|
|
30
|
+
var LoginSignUpTabs = /*#__PURE__*/function (_React$Component) {
|
|
34
31
|
_inherits(LoginSignUpTabs, _React$Component);
|
|
35
|
-
|
|
32
|
+
var _super = _createSuper(LoginSignUpTabs);
|
|
36
33
|
function LoginSignUpTabs() {
|
|
37
34
|
_classCallCheck(this, LoginSignUpTabs);
|
|
38
|
-
|
|
39
|
-
return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
|
35
|
+
return _super.apply(this, arguments);
|
|
40
36
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
37
|
+
_createClass(LoginSignUpTabs, [{
|
|
38
|
+
key: "render",
|
|
39
|
+
value: function render() {
|
|
40
|
+
var _this$props = this.props,
|
|
41
|
+
lock = _this$props.lock,
|
|
42
|
+
loginLabel = _this$props.loginLabel,
|
|
43
|
+
signUpLink = _this$props.signUpLink,
|
|
44
|
+
signUpLabel = _this$props.signUpLabel;
|
|
45
|
+
var isLogin = (0, _index2.getScreen)(lock) === 'login';
|
|
46
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
47
|
+
role: "navigation",
|
|
48
|
+
className: "auth0-lock-tabs-container"
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement("ul", {
|
|
50
|
+
className: "auth0-lock-tabs"
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(LoginSignUpTab, {
|
|
52
|
+
label: loginLabel,
|
|
53
|
+
current: isLogin,
|
|
54
|
+
clickHandler: this.handleLoginClick.bind(this)
|
|
55
|
+
}), /*#__PURE__*/_react.default.createElement(LoginSignUpTab, {
|
|
56
|
+
label: signUpLabel,
|
|
57
|
+
current: !isLogin,
|
|
58
|
+
clickHandler: this.handleSignUpClick.bind(this),
|
|
59
|
+
clickWithHrefHandler: this.handleSignUpWithHrefClick.bind(this),
|
|
60
|
+
href: signUpLink
|
|
61
|
+
})));
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
key: "handleLoginClick",
|
|
65
|
+
value: function handleLoginClick() {
|
|
66
|
+
(0, _actions.showLoginActivity)(l.id(this.props.lock));
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
key: "handleSignUpClick",
|
|
70
|
+
value: function handleSignUpClick() {
|
|
71
|
+
if (this.props.signUpLink) {
|
|
72
|
+
(0, _actions2.closeLock)(l.id(this.props.lock), true);
|
|
73
|
+
}
|
|
74
|
+
(0, _actions.showSignUpActivity)(l.id(this.props.lock));
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
key: "handleSignUpWithHrefClick",
|
|
78
|
+
value: function handleSignUpWithHrefClick() {
|
|
79
79
|
(0, _actions2.closeLock)(l.id(this.props.lock), true);
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
LoginSignUpTabs.prototype.handleSignUpWithHrefClick = function handleSignUpWithHrefClick() {
|
|
85
|
-
(0, _actions2.closeLock)(l.id(this.props.lock), true);
|
|
86
|
-
};
|
|
87
|
-
|
|
81
|
+
}]);
|
|
88
82
|
return LoginSignUpTabs;
|
|
89
|
-
}(
|
|
90
|
-
|
|
83
|
+
}(_react.default.Component);
|
|
91
84
|
exports.default = LoginSignUpTabs;
|
|
92
|
-
|
|
93
|
-
|
|
94
85
|
LoginSignUpTabs.propTypes = {
|
|
95
|
-
lock:
|
|
96
|
-
loginLabel:
|
|
97
|
-
signUpLabel:
|
|
98
|
-
signUpLink:
|
|
86
|
+
lock: _propTypes.default.object.isRequired,
|
|
87
|
+
loginLabel: _propTypes.default.string.isRequired,
|
|
88
|
+
signUpLabel: _propTypes.default.string.isRequired,
|
|
89
|
+
signUpLink: _propTypes.default.string
|
|
99
90
|
};
|
|
100
|
-
|
|
101
|
-
var LoginSignUpTab = function (_React$Component2) {
|
|
91
|
+
var LoginSignUpTab = /*#__PURE__*/function (_React$Component2) {
|
|
102
92
|
_inherits(LoginSignUpTab, _React$Component2);
|
|
103
|
-
|
|
93
|
+
var _super2 = _createSuper(LoginSignUpTab);
|
|
104
94
|
function LoginSignUpTab() {
|
|
105
|
-
var
|
|
106
|
-
|
|
95
|
+
var _this;
|
|
107
96
|
_classCallCheck(this, LoginSignUpTab);
|
|
108
|
-
|
|
109
|
-
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
97
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
110
98
|
args[_key] = arguments[_key];
|
|
111
99
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if (
|
|
115
|
-
|
|
100
|
+
_this = _super2.call.apply(_super2, [this].concat(args));
|
|
101
|
+
_defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
|
|
102
|
+
if (_this.props.href) {
|
|
103
|
+
_this.props.clickWithHrefHandler();
|
|
116
104
|
} else {
|
|
117
105
|
e.preventDefault();
|
|
118
|
-
|
|
106
|
+
_this.props.clickHandler();
|
|
119
107
|
}
|
|
120
|
-
}
|
|
108
|
+
});
|
|
109
|
+
return _this;
|
|
121
110
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
) : _react2.default.createElement(
|
|
139
|
-
'a',
|
|
140
|
-
{ href: href || '#', onClick: this.handleClick },
|
|
141
|
-
label
|
|
142
|
-
)
|
|
143
|
-
);
|
|
144
|
-
};
|
|
145
|
-
|
|
111
|
+
_createClass(LoginSignUpTab, [{
|
|
112
|
+
key: "render",
|
|
113
|
+
value: function render() {
|
|
114
|
+
var _this$props2 = this.props,
|
|
115
|
+
current = _this$props2.current,
|
|
116
|
+
href = _this$props2.href,
|
|
117
|
+
label = _this$props2.label;
|
|
118
|
+
var className = current ? 'auth0-lock-tabs-current' : '';
|
|
119
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
120
|
+
className: className
|
|
121
|
+
}, current ? /*#__PURE__*/_react.default.createElement("span", null, label) : /*#__PURE__*/_react.default.createElement("a", {
|
|
122
|
+
href: href || '#',
|
|
123
|
+
onClick: this.handleClick
|
|
124
|
+
}, label));
|
|
125
|
+
}
|
|
126
|
+
}]);
|
|
146
127
|
return LoginSignUpTab;
|
|
147
|
-
}(
|
|
128
|
+
}(_react.default.Component);
|