auth0-lock 14.2.1 → 14.2.3

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.
Files changed (78) hide show
  1. package/.github/actions/npm-publish/action.yml +5 -4
  2. package/.github/workflows/npm-release.yml +3 -3
  3. package/.github/workflows/release.yml +1 -2
  4. package/.github/workflows/snyk.yml +1 -1
  5. package/.github/workflows/test.yml +3 -3
  6. package/.version +1 -1
  7. package/CHANGELOG.md +15 -0
  8. package/README.md +1 -1
  9. package/lib/__tests__/connection/database/login_pane.js +6 -7
  10. package/lib/__tests__/connection/database/password_reset_confirmation.js +6 -7
  11. package/lib/__tests__/connection/database/signed_up_confirmation.js +6 -7
  12. package/lib/__tests__/connection/enterprise/quick_auth_screen.js +7 -8
  13. package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +6 -7
  14. package/lib/__tests__/core/signed_in_confirmation.js +6 -7
  15. package/lib/__tests__/i18n.js +5 -2
  16. package/lib/__tests__/ui/box/confirmation_pane.js +6 -7
  17. package/lib/core/web_api/helper.js +1 -1
  18. package/lib/i18n/af.js +2 -1
  19. package/lib/i18n/ar.js +2 -1
  20. package/lib/i18n/az.js +2 -1
  21. package/lib/i18n/bg.js +2 -1
  22. package/lib/i18n/ca.js +2 -1
  23. package/lib/i18n/cs.js +2 -1
  24. package/lib/i18n/da.js +2 -1
  25. package/lib/i18n/de.js +2 -1
  26. package/lib/i18n/el.js +2 -1
  27. package/lib/i18n/en.js +2 -1
  28. package/lib/i18n/es.js +2 -1
  29. package/lib/i18n/et.js +2 -1
  30. package/lib/i18n/fa.js +2 -1
  31. package/lib/i18n/fi.js +2 -1
  32. package/lib/i18n/fr.js +2 -1
  33. package/lib/i18n/he.js +2 -1
  34. package/lib/i18n/hr.js +2 -1
  35. package/lib/i18n/hu.js +2 -1
  36. package/lib/i18n/id.js +2 -1
  37. package/lib/i18n/it.js +2 -1
  38. package/lib/i18n/ja.js +2 -1
  39. package/lib/i18n/ko.js +2 -1
  40. package/lib/i18n/lt.js +2 -1
  41. package/lib/i18n/lv.js +2 -1
  42. package/lib/i18n/ms.js +2 -1
  43. package/lib/i18n/nb.js +2 -1
  44. package/lib/i18n/nl.js +2 -1
  45. package/lib/i18n/nn.js +2 -1
  46. package/lib/i18n/no.js +2 -1
  47. package/lib/i18n/pl.js +2 -1
  48. package/lib/i18n/pt-br.js +2 -1
  49. package/lib/i18n/pt.js +2 -1
  50. package/lib/i18n/ro.js +2 -1
  51. package/lib/i18n/ru.js +2 -1
  52. package/lib/i18n/sk.js +2 -1
  53. package/lib/i18n/sl.js +2 -1
  54. package/lib/i18n/sr.js +2 -1
  55. package/lib/i18n/sv.js +2 -1
  56. package/lib/i18n/tr.js +2 -1
  57. package/lib/i18n/ua.js +2 -1
  58. package/lib/i18n/uk.js +2 -1
  59. package/lib/i18n/vi.js +2 -1
  60. package/lib/i18n/zh-tw.js +2 -1
  61. package/lib/i18n/zh.js +2 -1
  62. package/lib/i18n.js +1 -1
  63. package/lib/lock.js +1 -1
  64. package/lib/passwordless.js +1 -1
  65. package/lib/ui/box/chrome.js +35 -20
  66. package/lib/ui/box/container.js +3 -2
  67. package/lib/ui/box/header.js +11 -7
  68. package/lib/ui/box/multisize_slide.js +27 -18
  69. package/lib/ui/input/captcha_input.js +2 -1
  70. package/lib/ui/input/email_input.js +2 -1
  71. package/lib/ui/input/mfa_code_input.js +3 -2
  72. package/lib/ui/input/password_input.js +3 -2
  73. package/lib/ui/input/phone_number_input.js +4 -3
  74. package/lib/ui/input/text_input.js +2 -1
  75. package/lib/ui/input/username_input.js +2 -1
  76. package/lib/ui/input/vcode_input.js +3 -2
  77. package/lib/ui/list.js +17 -12
  78. package/package.json +5 -5
package/lib/i18n/sl.js CHANGED
@@ -41,7 +41,8 @@ var _default = exports.default = {
41
41
  'bad.phone_number': 'Napačna telefonska številka',
42
42
  'lock.fallback': 'Žal je prišlo do napake',
43
43
  invalid_captcha: 'Rešite izzivno vprašanje in preverite, ali niste robot.',
44
- invalid_recaptcha: 'Izberite potrditveno polje, da preverite, da niste robot.'
44
+ invalid_recaptcha: 'Izberite potrditveno polje, da preverite, da niste robot.',
45
+ too_many_attempts: 'Po več zaporednih poskusih napačne prijave je bil vaš račun blokiran.'
45
46
  },
46
47
  signUp: {
47
48
  invalid_password: 'Napačno geslo.',
package/lib/i18n/sr.js CHANGED
@@ -41,7 +41,8 @@ var _default = exports.default = {
41
41
  'bad.phone_number': 'Broj telefona je nevažeći',
42
42
  'lock.fallback': 'Žao nam je, došlo je do greške',
43
43
  invalid_captcha: 'Решите изазовно питање да бисте потврдили да нисте робот.',
44
- invalid_recaptcha: 'Потврдите избор у пољу за потврду да нисте робот.'
44
+ invalid_recaptcha: 'Потврдите избор у пољу за потврду да нисте робот.',
45
+ too_many_attempts: 'Vaš nalog je blokiran nakon više uzastopnih pokušaja prijavljivanja.'
45
46
  },
46
47
  signUp: {
47
48
  invalid_password: 'Lozinka je nevažeća.',
package/lib/i18n/sv.js CHANGED
@@ -41,7 +41,8 @@ var _default = exports.default = {
41
41
  'bad.phone_number': 'Ditt telefonnummer är ogiltigt.',
42
42
  'lock.fallback': 'Något gick fel.',
43
43
  invalid_captcha: 'Lös utmaningsfrågan för att verifiera att du inte är en robot.',
44
- invalid_recaptcha: 'Markera kryssrutan för att verifiera att du inte är en robot.'
44
+ invalid_recaptcha: 'Markera kryssrutan för att verifiera att du inte är en robot.',
45
+ too_many_attempts: 'Ditt konto har blivit spärrat efter flera felaktiga inloggningsförsök.'
45
46
  },
46
47
  signUp: {
47
48
  invalid_password: 'Lösenordet är ogiltigt.',
package/lib/i18n/tr.js CHANGED
@@ -41,7 +41,8 @@ var _default = exports.default = {
41
41
  'bad.phone_number': 'Telefon numarası geçerli değil',
42
42
  'lock.fallback': 'Özür dileriz, bir hata oluştu',
43
43
  invalid_captcha: 'Robot olmadığınızı doğrulamak için meydan okuma sorusunu çözün.',
44
- invalid_recaptcha: 'Robot olmadığınızı doğrulamak için onay kutusunu seçin.'
44
+ invalid_recaptcha: 'Robot olmadığınızı doğrulamak için onay kutusunu seçin.',
45
+ too_many_attempts: 'Çok fazla giriş denemesi sonucunda hesabınız bloke oldu.'
45
46
  },
46
47
  signUp: {
47
48
  invalid_password: 'Şifre geçersiz.',
package/lib/i18n/ua.js CHANGED
@@ -41,7 +41,8 @@ var _default = exports.default = {
41
41
  'bad.phone_number': 'Недійсний номер телефону',
42
42
  'lock.fallback': 'Йой! Виникла непередбачувана помилка при спробі авторизації. Перепрошуємо.',
43
43
  invalid_captcha: 'Вирішіть складне питання, щоб переконатися, що ви не робот.',
44
- invalid_recaptcha: 'Установіть прапорець, щоб переконатися, що ви не робот.'
44
+ invalid_recaptcha: 'Установіть прапорець, щоб переконатися, що ви не робот.',
45
+ too_many_attempts: 'Ваш обліковий запис був заблокований після декількох послідовних спроб входу до системи.'
45
46
  },
46
47
  signUp: {
47
48
  invalid_password: 'Невірний пароль.',
package/lib/i18n/uk.js CHANGED
@@ -41,7 +41,8 @@ var _default = exports.default = {
41
41
  'bad.phone_number': 'Неправильний номер телефону',
42
42
  'lock.fallback': 'На жаль, сталася помилка',
43
43
  invalid_captcha: 'Вирішіть складне питання, щоб переконатися, що ви не робот.',
44
- invalid_recaptcha: 'Установіть прапорець, щоб переконатися, що ви не робот.'
44
+ invalid_recaptcha: 'Установіть прапорець, щоб переконатися, що ви не робот.',
45
+ too_many_attempts: 'Ваш обліковий запис заблоковано після декількох послідовних спроб входу в систему.'
45
46
  },
46
47
  signUp: {
47
48
  invalid_password: 'Неправильний пароль.',
package/lib/i18n/vi.js CHANGED
@@ -41,7 +41,8 @@ var _default = exports.default = {
41
41
  'bad.phone_number': 'Số điện thoại không hợp lệ.',
42
42
  'lock.fallback': 'Đã có lỗi xãy ra, chúng tôi rất lấy làm tiếc.',
43
43
  invalid_captcha: 'Giải quyết câu hỏi thử thách để xác minh bạn không phải là robot.',
44
- invalid_recaptcha: 'Chọn hộp kiểm để xác minh bạn không phải là robot.'
44
+ invalid_recaptcha: 'Chọn hộp kiểm để xác minh bạn không phải là robot.',
45
+ too_many_attempts: 'Tài khoản của bạn đã bị khóa do liên tục đăng nhập thất bại nhiều lần.'
45
46
  },
46
47
  signUp: {
47
48
  invalid_password: 'Mật khẩu không hợp lệ.',
package/lib/i18n/zh-tw.js CHANGED
@@ -41,7 +41,8 @@ var _default = exports.default = {
41
41
  'bad.phone_number': '手機號碼錯誤。',
42
42
  'lock.fallback': '對不起,發生錯誤。',
43
43
  invalid_captcha: '解決挑戰問題以驗證您不是機器人。',
44
- invalid_recaptcha: '選中復選框以確認您不是機器人。'
44
+ invalid_recaptcha: '選中復選框以確認您不是機器人。',
45
+ too_many_attempts: '由於登入異常頻繁,您的帳號已被鎖定。'
45
46
  },
46
47
  signUp: {
47
48
  invalid_password: '密碼錯誤',
package/lib/i18n/zh.js CHANGED
@@ -41,7 +41,8 @@ var _default = exports.default = {
41
41
  'bad.phone_number': '手机号码格式不正确。',
42
42
  'lock.fallback': '对不起,出现错误。',
43
43
  invalid_captcha: '解决挑战问题以验证您不是机器人。',
44
- invalid_recaptcha: '选中复选框以确认您不是机器人。'
44
+ invalid_recaptcha: '选中复选框以确认您不是机器人。',
45
+ too_many_attempts: '由于登录操作太频繁,您的帐号已被锁定。'
45
46
  },
46
47
  signUp: {
47
48
  invalid_password: '密码错误',
package/lib/i18n.js CHANGED
@@ -90,7 +90,7 @@ function assertLanguage(m, language, base) {
90
90
  function syncLang(m, language, _cb) {
91
91
  (0, _cdn_utils.load)({
92
92
  method: 'registerLanguageDictionary',
93
- url: "".concat(l.languageBaseUrl(m), "/js/lock/").concat("14.2.1", "/").concat(language, ".js"),
93
+ url: "".concat(l.languageBaseUrl(m), "/js/lock/").concat("14.2.3", "/").concat(language, ".js"),
94
94
  check: function check(str) {
95
95
  return str && str === language;
96
96
  },
package/lib/lock.js CHANGED
@@ -36,7 +36,7 @@ var Auth0Lock = exports.default = /*#__PURE__*/function (_Core) {
36
36
  _inherits(Auth0Lock, _Core);
37
37
  return _createClass(Auth0Lock);
38
38
  }(_core.default); // telemetry
39
- Auth0Lock.version = "14.2.1";
39
+ Auth0Lock.version = "14.2.3";
40
40
 
41
41
  // TODO: should we have different telemetry for classic/passwordless?
42
42
  // TODO: should we set telemetry info before each request?
@@ -36,4 +36,4 @@ var Auth0LockPasswordless = exports.default = /*#__PURE__*/function (_Core) {
36
36
  _inherits(Auth0LockPasswordless, _Core);
37
37
  return _createClass(Auth0LockPasswordless);
38
38
  }(_core.default);
39
- Auth0LockPasswordless.version = "14.2.1";
39
+ Auth0LockPasswordless.version = "14.2.3";
@@ -101,9 +101,12 @@ var SubmitTextSvg = function SubmitTextSvg() {
101
101
  }))));
102
102
  };
103
103
  var SubmitButton = /*#__PURE__*/function (_React$Component) {
104
- function SubmitButton() {
104
+ function SubmitButton(props) {
105
+ var _this;
105
106
  _classCallCheck(this, SubmitButton);
106
- return _callSuper(this, SubmitButton, arguments);
107
+ _this = _callSuper(this, SubmitButton, [props]);
108
+ _this.buttonRef = /*#__PURE__*/_react.default.createRef();
109
+ return _this;
107
110
  }
108
111
  _inherits(SubmitButton, _React$Component);
109
112
  return _createClass(SubmitButton, [{
@@ -132,7 +135,9 @@ var SubmitButton = /*#__PURE__*/function (_React$Component) {
132
135
  }, {
133
136
  key: "focus",
134
137
  value: function focus() {
135
- _reactDom.default.findDOMNode(this).focus();
138
+ if (this.buttonRef.current) {
139
+ this.buttonRef.current.focus();
140
+ }
136
141
  }
137
142
  }, {
138
143
  key: "render",
@@ -148,6 +153,7 @@ var SubmitButton = /*#__PURE__*/function (_React$Component) {
148
153
  className: "auth0-label-submit"
149
154
  }, label, /*#__PURE__*/_react.default.createElement(SubmitTextSvg, null)) : /*#__PURE__*/_react.default.createElement(SubmitSvg, null);
150
155
  return /*#__PURE__*/_react.default.createElement("button", {
156
+ ref: this.buttonRef,
151
157
  id: "".concat(l.id(model), "-submit"),
152
158
  className: "auth0-lock-submit",
153
159
  disabled: disabled,
@@ -180,15 +186,18 @@ var MESSAGE_ANIMATION_DURATION = 250;
180
186
  var AUXILIARY_ANIMATION_DURATION = 350;
181
187
  var Chrome = exports.default = /*#__PURE__*/function (_React$Component2) {
182
188
  function Chrome(props) {
183
- var _this;
189
+ var _this2;
184
190
  _classCallCheck(this, Chrome);
185
- _this = _callSuper(this, Chrome, [props]);
186
- _this.state = {
191
+ _this2 = _callSuper(this, Chrome, [props]);
192
+ _this2.state = {
187
193
  moving: false,
188
194
  reverse: false,
189
195
  headerHeight: 0
190
196
  };
191
- return _this;
197
+ _this2.screenRef = /*#__PURE__*/_react.default.createRef();
198
+ _this2.globalMessageRef = /*#__PURE__*/_react.default.createRef();
199
+ _this2.auxiliaryPaneRef = /*#__PURE__*/_react.default.createRef();
200
+ return _this2;
192
201
  }
193
202
 
194
203
  // eslint-disable-next-line react/no-deprecated
@@ -196,7 +205,7 @@ var Chrome = exports.default = /*#__PURE__*/function (_React$Component2) {
196
205
  return _createClass(Chrome, [{
197
206
  key: "UNSAFE_componentWillReceiveProps",
198
207
  value: function UNSAFE_componentWillReceiveProps(nextProps) {
199
- var _this2 = this;
208
+ var _this3 = this;
200
209
  var _this$props3 = this.props,
201
210
  auxiliaryPane = _this$props3.auxiliaryPane,
202
211
  showSubmitButton = _this$props3.showSubmitButton;
@@ -215,7 +224,7 @@ var Chrome = exports.default = /*#__PURE__*/function (_React$Component2) {
215
224
  if (auxiliaryPane && !nextProps.auxiliaryPane) {
216
225
  // TODO clear timeout
217
226
  setTimeout(function () {
218
- return _this2.setState({
227
+ return _this3.setState({
219
228
  moving: false
220
229
  });
221
230
  }, AUXILIARY_ANIMATION_DURATION + 50);
@@ -224,7 +233,7 @@ var Chrome = exports.default = /*#__PURE__*/function (_React$Component2) {
224
233
  }, {
225
234
  key: "componentDidUpdate",
226
235
  value: function componentDidUpdate(prevProps) {
227
- var _this3 = this;
236
+ var _this4 = this;
228
237
  var _this$props4 = this.props,
229
238
  autofocus = _this$props4.autofocus,
230
239
  auxiliaryPane = _this$props4.auxiliaryPane,
@@ -232,7 +241,7 @@ var Chrome = exports.default = /*#__PURE__*/function (_React$Component2) {
232
241
  screenName = _this$props4.screenName;
233
242
  if (!autofocus) return;
234
243
  if (auxiliaryPane && !prevProps.auxiliaryPane) {
235
- var input = this.findAutofocusInput(this.refs.auxiliary);
244
+ var input = this.findAutofocusInput(this.auxiliaryPaneRef.current);
236
245
  if (input) {
237
246
  // TODO clear timeout
238
247
  setTimeout(function () {
@@ -245,7 +254,7 @@ var Chrome = exports.default = /*#__PURE__*/function (_React$Component2) {
245
254
  if (this.auxiliaryPaneTriggerInput) {
246
255
  // TODO clear timeout
247
256
  setTimeout(function () {
248
- return _this3.auxiliaryPaneTriggerInput.focus();
257
+ return _this4.auxiliaryPaneTriggerInput.focus();
249
258
  }, AUXILIARY_ANIMATION_DURATION);
250
259
  }
251
260
  return;
@@ -304,12 +313,13 @@ var Chrome = exports.default = /*#__PURE__*/function (_React$Component2) {
304
313
  }, {
305
314
  key: "findAutofocusInput",
306
315
  value: function findAutofocusInput(ref) {
307
- return _reactDom.default.findDOMNode(ref || this.refs.screen).querySelector('input');
316
+ var node = ref || this.screenRef.current;
317
+ return node.querySelector('input');
308
318
  }
309
319
  }, {
310
320
  key: "focusError",
311
321
  value: function focusError() {
312
- var node = _reactDom.default.findDOMNode(this.refs.screen);
322
+ var node = this.screenRef.current;
313
323
  // TODO: make the error input selector configurable via props.
314
324
  var error = node.querySelector('.auth0-lock-error input');
315
325
  if (error) {
@@ -319,7 +329,7 @@ var Chrome = exports.default = /*#__PURE__*/function (_React$Component2) {
319
329
  }, {
320
330
  key: "render",
321
331
  value: function render() {
322
- var _this4 = this;
332
+ var _this5 = this;
323
333
  var _this$props5 = this.props,
324
334
  avatar = _this$props5.avatar,
325
335
  auxiliaryPane = _this$props5.auxiliaryPane,
@@ -411,13 +421,16 @@ var Chrome = exports.default = /*#__PURE__*/function (_React$Component2) {
411
421
  marginTop: this.state.headerHeight
412
422
  }
413
423
  }, /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.TransitionGroup, null, /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, {
424
+ nodeRef: this.globalMessageRef,
414
425
  classNames: "global-message",
415
426
  timeout: MESSAGE_ANIMATION_DURATION
416
- }, /*#__PURE__*/_react.default.createElement("div", null, globalSuccess, globalError, globalInfo))), /*#__PURE__*/_react.default.createElement("div", {
427
+ }, /*#__PURE__*/_react.default.createElement("div", {
428
+ ref: this.globalMessageRef
429
+ }, globalSuccess, globalError, globalInfo))), /*#__PURE__*/_react.default.createElement("div", {
417
430
  style: {
418
431
  position: 'relative'
419
432
  },
420
- ref: "screen"
433
+ ref: this.screenRef
421
434
  }, /*#__PURE__*/_react.default.createElement(_multisize_slide.default, {
422
435
  delay: 550,
423
436
  onDidAppear: this.onDidAppear.bind(this),
@@ -449,14 +462,16 @@ var Chrome = exports.default = /*#__PURE__*/function (_React$Component2) {
449
462
  contentProps: contentProps,
450
463
  label: submitButtonLabel,
451
464
  ref: function ref(el) {
452
- return _this4.submitButton = el;
465
+ return _this5.submitButton = el;
453
466
  },
454
467
  display: shouldShowSubmitButton ? 'block' : 'none'
455
468
  }), auxiliaryPane && /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.TransitionGroup, null, /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.CSSTransition, {
456
- ref: "auxiliary",
469
+ nodeRef: this.auxiliaryPaneRef,
457
470
  classNames: "slide",
458
471
  timeout: AUXILIARY_ANIMATION_DURATION
459
- }, auxiliaryPane))));
472
+ }, /*#__PURE__*/_react.default.cloneElement(auxiliaryPane, {
473
+ ref: this.auxiliaryPaneRef
474
+ })))));
460
475
  }
461
476
  }, {
462
477
  key: "focusSubmit",
@@ -104,6 +104,7 @@ var Container = exports.default = /*#__PURE__*/function (_React$Component) {
104
104
  _this.state = {
105
105
  isOpen: false
106
106
  };
107
+ _this.chromeRef = /*#__PURE__*/_react.default.createRef();
107
108
  return _this;
108
109
  }
109
110
  _inherits(Container, _React$Component);
@@ -176,7 +177,7 @@ var Container = exports.default = /*#__PURE__*/function (_React$Component) {
176
177
  if (submitHandler) {
177
178
  setTimeout(function () {
178
179
  if (!_this3.props.isSubmitting) {
179
- _this3.refs.chrome.focusError();
180
+ _this3.chromeRef.current.focusError();
180
181
  }
181
182
  }, 17);
182
183
  submitHandler();
@@ -307,7 +308,7 @@ var Container = exports.default = /*#__PURE__*/function (_React$Component) {
307
308
  logo: logo,
308
309
  screenName: screenName,
309
310
  primaryColor: primaryColor,
310
- ref: "chrome",
311
+ ref: this.chromeRef,
311
312
  showSubmitButton: !!submitHandler,
312
313
  submitButtonLabel: submitButtonLabel,
313
314
  success: success,
@@ -24,15 +24,18 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
24
24
  function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
25
25
  function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
26
26
  var Header = exports.default = /*#__PURE__*/function (_React$Component) {
27
- function Header() {
27
+ function Header(props) {
28
+ var _this;
28
29
  _classCallCheck(this, Header);
29
- return _callSuper(this, Header, arguments);
30
+ _this = _callSuper(this, Header, [props]);
31
+ _this.headerRef = /*#__PURE__*/_react.default.createRef();
32
+ return _this;
30
33
  }
31
34
  _inherits(Header, _React$Component);
32
35
  return _createClass(Header, [{
33
36
  key: "getDOMNode",
34
37
  value: function getDOMNode() {
35
- return _reactDom.default.findDOMNode(this);
38
+ return this.headerRef.current;
36
39
  }
37
40
  }, {
38
41
  key: "render",
@@ -45,6 +48,7 @@ var Header = exports.default = /*#__PURE__*/function (_React$Component) {
45
48
  name = _this$props.name,
46
49
  title = _this$props.title;
47
50
  return /*#__PURE__*/_react.default.createElement("div", {
51
+ ref: this.headerRef,
48
52
  className: "auth0-lock-header"
49
53
  }, backHandler && /*#__PURE__*/_react.default.createElement(_button.BackButton, {
50
54
  onClick: backHandler
@@ -67,19 +71,19 @@ Header.propTypes = {
67
71
  };
68
72
  var Welcome = /*#__PURE__*/function (_React$Component2) {
69
73
  function Welcome() {
70
- var _this;
74
+ var _this2;
71
75
  _classCallCheck(this, Welcome);
72
76
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
73
77
  args[_key] = arguments[_key];
74
78
  }
75
- _this = _callSuper(this, Welcome, [].concat(args));
79
+ _this2 = _callSuper(this, Welcome, [].concat(args));
76
80
  // Cause a reflow when the image is loaded to fix an issue with the Lock content sometimes
77
81
  // not rendering in a popup on first load.
78
82
  // https://github.com/auth0/lock/issues/1942
79
- _defineProperty(_this, "onImageLoad", function () {
83
+ _defineProperty(_this2, "onImageLoad", function () {
80
84
  return document.querySelector('.auth0-lock').style.fontSize = '1rem';
81
85
  });
82
- return _this;
86
+ return _this2;
83
87
  }
84
88
  _inherits(Welcome, _React$Component2);
85
89
  return _createClass(Welcome, [{
@@ -33,6 +33,7 @@ var Slider = exports.default = /*#__PURE__*/function (_React$Component) {
33
33
  current: props.children
34
34
  }
35
35
  };
36
+ _this.childRefs = {};
36
37
  return _this;
37
38
  }
38
39
 
@@ -73,11 +74,12 @@ var Slider = exports.default = /*#__PURE__*/function (_React$Component) {
73
74
  current = _this$state$children.current,
74
75
  prev = _this$state$children.prev;
75
76
  var reverse = this.props.reverse;
76
- var currentComponent = this.refs[current.key];
77
- var prevComponent = this.refs[prev.key];
77
+ var currentComponent = this.childRefs[current.key] && this.childRefs[current.key].current;
78
+ var prevComponent = this.childRefs[prev.key] && this.childRefs[prev.key].current;
78
79
  var transition = function transition(component, className, delay) {
79
- // eslint-disable-next-line
80
- var node = _reactDom.default.findDOMNode(component);
80
+ // Get the DOM node directly from the component's node property
81
+ var node = component === null || component === void 0 ? void 0 : component.node;
82
+ if (!node) return;
81
83
  var activeClassName = "".concat(className, "-active");
82
84
  _CSSCore.default.addClass(node, className);
83
85
  setTimeout(function () {
@@ -120,13 +122,18 @@ var Slider = exports.default = /*#__PURE__*/function (_React$Component) {
120
122
  }, {
121
123
  key: "render",
122
124
  value: function render() {
125
+ var _this3 = this;
123
126
  var _this$state$children2 = this.state.children,
124
127
  current = _this$state$children2.current,
125
128
  prev = _this$state$children2.prev;
126
129
  var children = prev ? [current, prev] : [current];
127
130
  var childrenToRender = children.map(function (child) {
131
+ // Create a ref for this child if it doesn't exist
132
+ if (!_this3.childRefs[child.key]) {
133
+ _this3.childRefs[child.key] = /*#__PURE__*/_react.default.createRef();
134
+ }
128
135
  return /*#__PURE__*/_react.default.cloneElement(/*#__PURE__*/_react.default.createElement(Child, {}, child), {
129
- ref: child.key,
136
+ ref: _this3.childRefs[child.key],
130
137
  key: child.key
131
138
  });
132
139
  });
@@ -153,21 +160,22 @@ Slider.defaultProps = {
153
160
  };
154
161
  var Child = /*#__PURE__*/function (_React$Component2) {
155
162
  function Child(props) {
156
- var _this3;
163
+ var _this4;
157
164
  _classCallCheck(this, Child);
158
- _this3 = _callSuper(this, Child, [props]);
159
- _defineProperty(_this3, "node", void 0);
160
- _this3.state = {
165
+ _this4 = _callSuper(this, Child, [props]);
166
+ _defineProperty(_this4, "node", void 0);
167
+ _this4.state = {
161
168
  height: '',
162
169
  originalHeight: '',
163
170
  show: true
164
171
  };
165
- return _this3;
172
+ return _this4;
166
173
  }
167
174
  _inherits(Child, _React$Component2);
168
175
  return _createClass(Child, [{
169
176
  key: "componentWillSlideIn",
170
177
  value: function componentWillSlideIn(slide) {
178
+ if (!this.node) return;
171
179
  this.setState({
172
180
  height: slide.height,
173
181
  originalHeight: parseInt(window.getComputedStyle(this.node, null).height, 10),
@@ -177,7 +185,7 @@ var Child = /*#__PURE__*/function (_React$Component2) {
177
185
  }, {
178
186
  key: "componentDidSlideIn",
179
187
  value: function componentDidSlideIn(cb) {
180
- var _this4 = this;
188
+ var _this5 = this;
181
189
  var _this$state = this.state,
182
190
  height = _this$state.height,
183
191
  originalHeight = _this$state.originalHeight;
@@ -200,20 +208,20 @@ var Child = /*#__PURE__*/function (_React$Component2) {
200
208
  // TODO: rAF
201
209
  this.t = setInterval(function () {
202
210
  if (count < frames - 1) {
203
- _this4.setState({
211
+ _this5.setState({
204
212
  height: current,
205
213
  animating: true
206
214
  });
207
215
  current += dh;
208
216
  count++;
209
217
  } else {
210
- clearInterval(_this4.t);
211
- delete _this4.t;
212
- _this4.setState({
218
+ clearInterval(_this5.t);
219
+ delete _this5.t;
220
+ _this5.setState({
213
221
  height: '',
214
222
  show: true
215
223
  });
216
- _this4.cb();
224
+ _this5.cb();
217
225
  }
218
226
  }, 17);
219
227
  }
@@ -221,6 +229,7 @@ var Child = /*#__PURE__*/function (_React$Component2) {
221
229
  }, {
222
230
  key: "componentWillSlideOut",
223
231
  value: function componentWillSlideOut(cb) {
232
+ if (!this.node) return;
224
233
  var size = window.getComputedStyle(this.node, null).height;
225
234
  cb({
226
235
  height: parseInt(size, 10),
@@ -238,14 +247,14 @@ var Child = /*#__PURE__*/function (_React$Component2) {
238
247
  }, {
239
248
  key: "render",
240
249
  value: function render() {
241
- var _this5 = this;
250
+ var _this6 = this;
242
251
  var children = this.props.children;
243
252
  var _this$state2 = this.state,
244
253
  height = _this$state2.height,
245
254
  show = _this$state2.show;
246
255
  return /*#__PURE__*/_react.default.createElement("div", {
247
256
  ref: function ref(node) {
248
- return _this5.node = node;
257
+ return _this6.node = node;
249
258
  },
250
259
  style: height ? {
251
260
  height: height + 'px'
@@ -96,6 +96,7 @@ var CaptchaInput = exports.default = /*#__PURE__*/function (_React$Component) {
96
96
  });
97
97
  });
98
98
  _this.state = {};
99
+ _this.inputRef = /*#__PURE__*/_react.default.createRef();
99
100
  return _this;
100
101
  }
101
102
  _inherits(CaptchaInput, _React$Component);
@@ -142,7 +143,7 @@ var CaptchaInput = exports.default = /*#__PURE__*/function (_React$Component) {
142
143
  icon: InputIconSvg
143
144
  }, /*#__PURE__*/_react.default.createElement("input", _extends({
144
145
  id: "".concat(lockId, "-captcha"),
145
- ref: "input",
146
+ ref: this.inputRef,
146
147
  type: "text",
147
148
  inputMode: "text",
148
149
  name: "captcha",
@@ -57,6 +57,7 @@ var EmailInput = exports.default = /*#__PURE__*/function (_React$Component) {
57
57
  _classCallCheck(this, EmailInput);
58
58
  _this = _callSuper(this, EmailInput, [props]);
59
59
  _this.state = {};
60
+ _this.inputRef = /*#__PURE__*/_react.default.createRef();
60
61
  return _this;
61
62
  }
62
63
  _inherits(EmailInput, _React$Component);
@@ -90,7 +91,7 @@ var EmailInput = exports.default = /*#__PURE__*/function (_React$Component) {
90
91
  icon: SVG
91
92
  }, /*#__PURE__*/_react.default.createElement("input", _extends({
92
93
  id: "".concat(lockId, "-email"),
93
- ref: "input",
94
+ ref: this.inputRef,
94
95
  type: "email",
95
96
  inputMode: "email",
96
97
  name: "email",
@@ -33,13 +33,14 @@ var MFACodeInput = exports.default = /*#__PURE__*/function (_React$Component) {
33
33
  _classCallCheck(this, MFACodeInput);
34
34
  _this = _callSuper(this, MFACodeInput, [props]);
35
35
  _this.state = {};
36
+ _this.inputRef = /*#__PURE__*/_react.default.createRef();
36
37
  return _this;
37
38
  }
38
39
  _inherits(MFACodeInput, _React$Component);
39
40
  return _createClass(MFACodeInput, [{
40
41
  key: "focus",
41
42
  value: function focus() {
42
- this.refs.input && this.refs.input.focus();
43
+ this.inputRef.current && this.inputRef.current.focus();
43
44
  }
44
45
  }, {
45
46
  key: "hasFocus",
@@ -65,7 +66,7 @@ var MFACodeInput = exports.default = /*#__PURE__*/function (_React$Component) {
65
66
  icon: _password_input.IconSvg
66
67
  }, /*#__PURE__*/_react.default.createElement("input", _extends({
67
68
  id: "".concat(lockId, "-mfa_code"),
68
- ref: "input",
69
+ ref: this.inputRef,
69
70
  type: "text",
70
71
  name: "mfa_code",
71
72
  className: "auth0-lock-input",
@@ -56,13 +56,14 @@ var PasswordInput = exports.default = /*#__PURE__*/function (_React$Component) {
56
56
  _classCallCheck(this, PasswordInput);
57
57
  _this = _callSuper(this, PasswordInput, [props]);
58
58
  _this.state = {};
59
+ _this.inputRef = /*#__PURE__*/_react.default.createRef();
59
60
  return _this;
60
61
  }
61
62
  _inherits(PasswordInput, _React$Component);
62
63
  return _createClass(PasswordInput, [{
63
64
  key: "focus",
64
65
  value: function focus() {
65
- this.refs.input && this.refs.input.focus();
66
+ this.inputRef.current && this.inputRef.current.focus();
66
67
  }
67
68
  }, {
68
69
  key: "hasFocus",
@@ -100,7 +101,7 @@ var PasswordInput = exports.default = /*#__PURE__*/function (_React$Component) {
100
101
  name: "password",
101
102
  icon: IconSvg
102
103
  }, /*#__PURE__*/_react.default.createElement("input", _extends({
103
- ref: "input",
104
+ ref: this.inputRef,
104
105
  type: showPassword ? 'text' : 'password',
105
106
  id: "".concat(l.id(lock), "-password"),
106
107
  name: "password",
@@ -57,6 +57,7 @@ var PhoneNumberInput = exports.default = /*#__PURE__*/function (_React$Component
57
57
  _classCallCheck(this, PhoneNumberInput);
58
58
  _this = _callSuper(this, PhoneNumberInput, [props]);
59
59
  _this.state = {};
60
+ _this.inputRef = /*#__PURE__*/_react.default.createRef();
60
61
  return _this;
61
62
  }
62
63
  _inherits(PhoneNumberInput, _React$Component);
@@ -75,7 +76,7 @@ var PhoneNumberInput = exports.default = /*#__PURE__*/function (_React$Component
75
76
  name: "phone-number",
76
77
  icon: IconSvg
77
78
  }, /*#__PURE__*/_react.default.createElement("input", _extends({
78
- ref: "input",
79
+ ref: this.inputRef,
79
80
  type: "tel",
80
81
  name: "phoneNumber",
81
82
  className: "auth0-lock-input auth0-lock-input-number",
@@ -92,8 +93,8 @@ var PhoneNumberInput = exports.default = /*#__PURE__*/function (_React$Component
92
93
  }, {
93
94
  key: "focus",
94
95
  value: function focus() {
95
- if (!this.refs.input) return;
96
- this.refs.input.focus();
96
+ if (!this.inputRef.current) return;
97
+ this.inputRef.current.focus();
97
98
  this.handleFocus();
98
99
  }
99
100
  }, {
@@ -30,6 +30,7 @@ var TextInput = exports.default = /*#__PURE__*/function (_React$Component) {
30
30
  _classCallCheck(this, TextInput);
31
31
  _this = _callSuper(this, TextInput, [props]);
32
32
  _this.state = {};
33
+ _this.inputRef = /*#__PURE__*/_react.default.createRef();
33
34
  return _this;
34
35
  }
35
36
  _inherits(TextInput, _React$Component);
@@ -68,7 +69,7 @@ var TextInput = exports.default = /*#__PURE__*/function (_React$Component) {
68
69
  icon: icon
69
70
  }, /*#__PURE__*/_react.default.createElement("input", _extends({
70
71
  id: "".concat(lockId, "-").concat(name),
71
- ref: "input",
72
+ ref: this.inputRef,
72
73
  type: "text",
73
74
  name: name,
74
75
  className: "auth0-lock-input",
@@ -51,6 +51,7 @@ var UsernameInput = exports.default = /*#__PURE__*/function (_React$Component) {
51
51
  _classCallCheck(this, UsernameInput);
52
52
  _this = _callSuper(this, UsernameInput, [props]);
53
53
  _this.state = {};
54
+ _this.inputRef = /*#__PURE__*/_react.default.createRef();
54
55
  return _this;
55
56
  }
56
57
  _inherits(UsernameInput, _React$Component);
@@ -83,7 +84,7 @@ var UsernameInput = exports.default = /*#__PURE__*/function (_React$Component) {
83
84
  name: "username",
84
85
  icon: IconSvg
85
86
  }, /*#__PURE__*/_react.default.createElement("input", _extends({
86
- ref: "input",
87
+ ref: this.inputRef,
87
88
  type: "text",
88
89
  name: "username",
89
90
  className: "auth0-lock-input",