auth0-lock 14.2.1 → 14.2.2

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.
@@ -56,8 +56,11 @@ describe('i18n', function () {
56
56
  }
57
57
  });
58
58
  var html = i18n.html(m, 'test');
59
- expect(html.props.dangerouslySetInnerHTML.__html).not.toMatch(/javascript:alert/);
60
- expect(html.props.dangerouslySetInnerHTML.__html).toEqual('<img href="1" src="1">');
59
+ var sanitized = html.props.dangerouslySetInnerHTML.__html;
60
+ expect(sanitized).not.toMatch(/javascript:alert/);
61
+ expect(sanitized).toMatch(/src="1"/);
62
+ expect(sanitized).toMatch(/href="1"/);
63
+ expect(sanitized).toMatch(/<img[^>]*>/);
61
64
  });
62
65
  it('should allow target=_blank with noopener noreferrer attributes', function () {
63
66
  (0, _sanitizer.initSanitizer)();
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
3
  var _react = _interopRequireDefault(require("react"));
5
4
  var _immutable = _interopRequireDefault(require("immutable"));
6
5
  var _testUtils = require("testUtils");
7
6
  var _confirmation_pane = _interopRequireDefault(require("../../../ui/box/confirmation_pane"));
8
7
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { Object.defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = Object.getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l); function g(t) { ["next", "throw", "return"].forEach(function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == _typeof(f) && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i.return && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(_typeof(r) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), c(GeneratorFunctionPrototype, u, GeneratorFunction.displayName = "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, catch: function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
8
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
9
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
10
10
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
11
11
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
12
12
  var defaultProps = {
@@ -19,14 +19,13 @@ var defaultProps = {
19
19
  svg: /*#__PURE__*/_react.default.createElement("svg", null, "svg")
20
20
  };
21
21
  describe('ConfirmationPane', function () {
22
- it('renders correctly', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
23
- return _regeneratorRuntime().wrap(function _callee$(_context) {
24
- while (1) switch (_context.prev = _context.next) {
22
+ it('renders correctly', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
23
+ return _regenerator().w(function (_context) {
24
+ while (1) switch (_context.n) {
25
25
  case 0:
26
26
  (0, _testUtils.expectComponent)(/*#__PURE__*/_react.default.createElement(_confirmation_pane.default, defaultProps)).toMatchSnapshot();
27
27
  case 1:
28
- case "end":
29
- return _context.stop();
28
+ return _context.a(2);
30
29
  }
31
30
  }, _callee);
32
31
  })));
@@ -169,5 +169,5 @@ function trimAuthParams() {
169
169
  return p;
170
170
  }
171
171
  function getVersion() {
172
- return "14.2.1";
172
+ return "14.2.2";
173
173
  }
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.2", "/").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.2";
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.2";
@@ -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",