auth0-lock 12.4.0 → 12.5.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.
Files changed (162) hide show
  1. package/.github/workflows/test.yml +1 -1
  2. package/.version +1 -1
  3. package/CHANGELOG.md +5 -0
  4. package/Makefile +1 -1
  5. package/README.md +1 -1
  6. package/lib/__tests__/connection/database/actions.js +1 -1
  7. package/lib/__tests__/connection/database/index.js +1 -1
  8. package/lib/__tests__/connection/database/login_pane.js +1 -1
  9. package/lib/__tests__/connection/database/password_reset_confirmation.js +1 -1
  10. package/lib/__tests__/connection/database/signed_up_confirmation.js +1 -1
  11. package/lib/__tests__/connection/enterprise/actions.js +1 -1
  12. package/lib/__tests__/connection/enterprise/hrd_pane.js +1 -1
  13. package/lib/__tests__/connection/enterprise/hrd_screen.js +1 -1
  14. package/lib/__tests__/connection/enterprise/quick_auth_screen.js +1 -1
  15. package/lib/__tests__/connection/passwordless/ask_vcode.js +1 -1
  16. package/lib/__tests__/connection/passwordless/email_sent_confirmation.js +1 -1
  17. package/lib/__tests__/core/actions.js +2 -2
  18. package/lib/__tests__/core/remote_data.js +1 -1
  19. package/lib/__tests__/core/signed_in_confirmation.js +1 -1
  20. package/lib/__tests__/core/sso/last_login_screen.js +1 -1
  21. package/lib/__tests__/core/tenant.js +1 -1
  22. package/lib/__tests__/core/web_api.js +1 -1
  23. package/lib/__tests__/engine/classic.js +1 -1
  24. package/lib/__tests__/field/captcha/third_party_captcha.js +1 -1
  25. package/lib/__tests__/field/field.js +1 -1
  26. package/lib/__tests__/i18n.js +1 -1
  27. package/lib/__tests__/testUtils.js +2 -2
  28. package/lib/__tests__/ui/box/chrome.js +1 -1
  29. package/lib/__tests__/ui/box/confirmation_pane.js +1 -1
  30. package/lib/avatar.js +1 -1
  31. package/lib/connection/captcha.js +54 -20
  32. package/lib/connection/database/actions.js +19 -8
  33. package/lib/connection/database/index.js +1 -1
  34. package/lib/connection/database/login_pane.js +11 -13
  35. package/lib/connection/database/login_sign_up_tabs.js +13 -17
  36. package/lib/connection/database/mfa_pane.js +8 -10
  37. package/lib/connection/database/password_reset_confirmation.js +9 -11
  38. package/lib/connection/database/reset_password.js +12 -16
  39. package/lib/connection/database/reset_password_pane.js +20 -12
  40. package/lib/connection/database/signed_up_confirmation.js +9 -11
  41. package/lib/connection/enterprise/actions.js +4 -4
  42. package/lib/connection/enterprise/hrd_pane.js +10 -12
  43. package/lib/connection/enterprise/hrd_screen.js +9 -11
  44. package/lib/connection/enterprise/kerberos_screen.js +9 -11
  45. package/lib/connection/enterprise/quick_auth_screen.js +9 -11
  46. package/lib/connection/enterprise.js +1 -1
  47. package/lib/connection/passwordless/actions.js +7 -7
  48. package/lib/connection/passwordless/ask_vcode.js +8 -10
  49. package/lib/connection/passwordless/email_sent_confirmation.js +16 -22
  50. package/lib/connection/passwordless/index.js +1 -1
  51. package/lib/connection/social/index.js +1 -1
  52. package/lib/core/actions.js +2 -2
  53. package/lib/core/client/index.js +2 -2
  54. package/lib/core/client/settings.js +1 -1
  55. package/lib/core/error_screen.js +9 -11
  56. package/lib/core/index.js +13 -4
  57. package/lib/core/loading_screen.js +12 -16
  58. package/lib/core/remote_data.js +9 -1
  59. package/lib/core/screen.js +3 -4
  60. package/lib/core/signed_in_confirmation.js +9 -11
  61. package/lib/core/sso/last_login_screen.js +9 -11
  62. package/lib/core/tenant/index.js +2 -2
  63. package/lib/core/tenant/settings.js +1 -1
  64. package/lib/core/web_api/helper.js +3 -3
  65. package/lib/core/web_api/p2_api.js +8 -3
  66. package/lib/core/web_api.js +7 -3
  67. package/lib/core.js +12 -14
  68. package/lib/engine/classic/login.js +9 -11
  69. package/lib/engine/classic/mfa_login_screen.js +9 -11
  70. package/lib/engine/classic/sign_up_pane.js +10 -12
  71. package/lib/engine/classic/sign_up_screen.js +9 -11
  72. package/lib/engine/classic.js +3 -4
  73. package/lib/engine/passwordless/social_or_email_login_screen.js +11 -13
  74. package/lib/engine/passwordless/social_or_phone_number_login_screen.js +11 -13
  75. package/lib/engine/passwordless.js +3 -4
  76. package/lib/field/captcha/captcha_pane.js +16 -15
  77. package/lib/field/captcha/third_party_captcha.js +8 -10
  78. package/lib/field/custom_input.js +1 -1
  79. package/lib/field/email/email_pane.js +9 -11
  80. package/lib/field/email.js +1 -1
  81. package/lib/field/index.js +1 -1
  82. package/lib/field/mfa-code/mfa_code_pane.js +9 -11
  83. package/lib/field/password/password_pane.js +11 -13
  84. package/lib/field/phone-number/phone_number_pane.js +10 -12
  85. package/lib/field/social/event.js +1 -1
  86. package/lib/field/social/social_buttons_pane.js +9 -11
  87. package/lib/field/username/username_pane.js +9 -11
  88. package/lib/field/vcode/vcode_pane.js +11 -13
  89. package/lib/i18n/af.js +3 -1
  90. package/lib/i18n/ar.js +3 -1
  91. package/lib/i18n/az.js +3 -1
  92. package/lib/i18n/bg.js +3 -1
  93. package/lib/i18n/ca.js +3 -1
  94. package/lib/i18n/cs.js +3 -1
  95. package/lib/i18n/da.js +3 -1
  96. package/lib/i18n/de.js +3 -1
  97. package/lib/i18n/el.js +3 -1
  98. package/lib/i18n/en.js +3 -1
  99. package/lib/i18n/es.js +3 -1
  100. package/lib/i18n/et.js +3 -1
  101. package/lib/i18n/fa.js +3 -1
  102. package/lib/i18n/fi.js +3 -1
  103. package/lib/i18n/fr.js +3 -1
  104. package/lib/i18n/he.js +3 -1
  105. package/lib/i18n/hr.js +3 -1
  106. package/lib/i18n/hu.js +3 -1
  107. package/lib/i18n/id.js +3 -1
  108. package/lib/i18n/it.js +3 -1
  109. package/lib/i18n/ja.js +3 -1
  110. package/lib/i18n/ko.js +3 -1
  111. package/lib/i18n/lt.js +3 -1
  112. package/lib/i18n/lv.js +3 -1
  113. package/lib/i18n/ms.js +3 -1
  114. package/lib/i18n/nb.js +3 -1
  115. package/lib/i18n/nl.js +3 -1
  116. package/lib/i18n/nn.js +3 -1
  117. package/lib/i18n/no.js +3 -1
  118. package/lib/i18n/pl.js +3 -1
  119. package/lib/i18n/pt-br.js +3 -1
  120. package/lib/i18n/pt.js +3 -1
  121. package/lib/i18n/ro.js +3 -1
  122. package/lib/i18n/ru.js +3 -1
  123. package/lib/i18n/sk.js +3 -1
  124. package/lib/i18n/sl.js +3 -1
  125. package/lib/i18n/sr.js +3 -1
  126. package/lib/i18n/sv.js +3 -1
  127. package/lib/i18n/tr.js +3 -1
  128. package/lib/i18n/ua.js +3 -1
  129. package/lib/i18n/uk.js +3 -1
  130. package/lib/i18n/vi.js +3 -1
  131. package/lib/i18n/zh-tw.js +3 -1
  132. package/lib/i18n/zh.js +3 -1
  133. package/lib/i18n.js +2 -2
  134. package/lib/lock.js +9 -10
  135. package/lib/passwordless.js +9 -10
  136. package/lib/quick-auth/actions.js +2 -2
  137. package/lib/sync.js +1 -1
  138. package/lib/ui/box/chrome.js +12 -16
  139. package/lib/ui/box/confirmation_pane.js +1 -1
  140. package/lib/ui/box/container.js +10 -13
  141. package/lib/ui/box/global_message.js +8 -10
  142. package/lib/ui/box/header.js +18 -26
  143. package/lib/ui/box/multisize_slide.js +12 -16
  144. package/lib/ui/box.js +3 -5
  145. package/lib/ui/input/captcha_input.js +13 -15
  146. package/lib/ui/input/checkbox_input.js +8 -10
  147. package/lib/ui/input/email_input.js +9 -11
  148. package/lib/ui/input/input_wrap.js +8 -10
  149. package/lib/ui/input/location_input.js +8 -10
  150. package/lib/ui/input/mfa_code_input.js +9 -11
  151. package/lib/ui/input/password/password_strength.js +14 -20
  152. package/lib/ui/input/password_input.js +10 -12
  153. package/lib/ui/input/phone_number_input.js +9 -11
  154. package/lib/ui/input/select_input.js +8 -10
  155. package/lib/ui/input/text_input.js +9 -11
  156. package/lib/ui/input/username_input.js +9 -11
  157. package/lib/ui/input/vcode_input.js +9 -11
  158. package/lib/ui/list.js +15 -21
  159. package/lib/utils/atom.js +2 -3
  160. package/lib/utils/cache.js +2 -3
  161. package/lib/utils/jsonp_utils.js +2 -3
  162. package/package.json +2 -2
@@ -14,10 +14,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
14
14
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
15
15
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
16
  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; }
17
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
18
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
19
19
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
20
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
20
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
21
21
  var expectComponent = exports.expectComponent = function expectComponent(children, opts) {
22
22
  var component = _reactTestRenderer.default.create(children, opts);
23
23
  return expect(component);
@@ -8,7 +8,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8
8
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
9
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
10
  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; }
11
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
12
12
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
13
  var getComponent = function getComponent() {
14
14
  return require('ui/box/chrome').default;
@@ -6,7 +6,7 @@ var _immutable = _interopRequireDefault(require("immutable"));
6
6
  var _testUtils = require("testUtils");
7
7
  var _confirmation_pane = _interopRequireDefault(require("../../../ui/box/confirmation_pane"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { 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 && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
9
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { 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 && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
10
10
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
11
11
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
12
12
  var defaultProps = {
package/lib/avatar.js CHANGED
@@ -12,7 +12,7 @@ var preload = _interopRequireWildcard(require("./utils/preload_utils"));
12
12
  var f = _interopRequireWildcard(require("./utils/fn_utils"));
13
13
  var l = _interopRequireWildcard(require("./core/index"));
14
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
15
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
16
  var _dataFns = (0, _data_utils.dataFns)(['avatar']),
17
17
  tget = _dataFns.tget,
18
18
  tset = _dataFns.tset;
@@ -4,6 +4,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ exports.Flow = void 0;
8
+ exports.getCaptchaConfig = getCaptchaConfig;
7
9
  exports.setCaptchaParams = setCaptchaParams;
8
10
  exports.showMissingCaptcha = showMissingCaptcha;
9
11
  exports.swapCaptcha = swapCaptcha;
@@ -14,18 +16,40 @@ var _index3 = require("../store/index");
14
16
  var _web_api = _interopRequireDefault(require("../core/web_api"));
15
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
18
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
17
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
+ var Flow = exports.Flow = Object.freeze({
21
+ DEFAULT: 'default',
22
+ PASSWORDLESS: 'passwordless',
23
+ PASSWORD_RESET: 'password_reset'
24
+ });
25
+
26
+ /**
27
+ * Return the captcha config object based on the type of flow.
28
+ *
29
+ * @param {Object} m model
30
+ * @param {Flow} flow Which flow the captcha is being rendered in
31
+ */
32
+ function getCaptchaConfig(m, flow) {
33
+ if (flow === Flow.PASSWORD_RESET) {
34
+ return l.passwordResetCaptcha(m);
35
+ } else if (flow === Flow.PASSWORDLESS) {
36
+ return l.passwordlessCaptcha(m);
37
+ } else {
38
+ return l.captcha(m);
39
+ }
40
+ }
41
+
18
42
  /**
19
43
  * Display the error message of missing captcha in the header of lock.
20
44
  *
21
45
  * @param {Object} m model
22
46
  * @param {Number} id
23
- * @param {Boolean} isPasswordless Whether the captcha is being rendered in a passwordless flow
47
+ * @param {Flow} flow Which flow the captcha is being rendered in
24
48
  */
25
49
  function showMissingCaptcha(m, id) {
26
- var isPasswordless = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
27
- var captchaConfig = isPasswordless ? l.passwordlessCaptcha(m) : l.captcha(m);
28
- var captchaError = captchaConfig.get('provider') === 'recaptcha_v2' || captchaConfig.get('provider') === 'recaptcha_enterprise' || captchaConfig.get('provider') === 'hcaptcha' || captchaConfig.get('provider') === 'auth0_v2' || captchaConfig.get('provider') === 'friendly_captcha' ? 'invalid_recaptcha' : 'invalid_captcha';
50
+ var flow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Flow.DEFAULT;
51
+ var captchaConfig = getCaptchaConfig(m, flow);
52
+ var captchaError = captchaConfig.get('provider') === 'recaptcha_v2' || captchaConfig.get('provider') === 'recaptcha_enterprise' || captchaConfig.get('provider') === 'hcaptcha' || captchaConfig.get('provider') === 'auth0_v2' || captchaConfig.get('provider') === 'friendly_captcha' || captchaConfig.get('provider') === 'arkose' ? 'invalid_recaptcha' : 'invalid_captcha';
29
53
  var errorMessage = i18n.html(m, ['error', 'login', captchaError]);
30
54
  (0, _index3.swap)(_index3.updateEntity, 'lock', id, function (m) {
31
55
  m = l.setSubmitting(m, false, errorMessage);
@@ -39,19 +63,19 @@ function showMissingCaptcha(m, id) {
39
63
  *
40
64
  * @param {Object} m model
41
65
  * @param {Object} params
42
- * @param {Boolean} isPasswordless Whether the captcha is being rendered in a passwordless flow
66
+ * @param {Flow} flow Which flow the captcha is being rendered in
43
67
  * @param {Object} fields
44
68
  *
45
69
  * @returns {Boolean} returns true if is required and missing the response from the user
46
70
  */
47
- function setCaptchaParams(m, params, isPasswordless, fields) {
48
- var captchaConfig = isPasswordless ? l.passwordlessCaptcha(m) : l.captcha(m);
71
+ function setCaptchaParams(m, params, flow, fields) {
72
+ var captchaConfig = getCaptchaConfig(m, flow);
49
73
  var isCaptchaRequired = captchaConfig && captchaConfig.get('required');
50
74
  if (!isCaptchaRequired) {
51
75
  return true;
52
76
  }
53
77
  var captcha = c.getFieldValue(m, 'captcha');
54
- //captcha required and missing
78
+ // captcha required and missing
55
79
  if (!captcha) {
56
80
  return false;
57
81
  }
@@ -64,12 +88,21 @@ function setCaptchaParams(m, params, isPasswordless, fields) {
64
88
  * Get a new challenge and display the new captcha image.
65
89
  *
66
90
  * @param {number} id The id of the Lock instance.
67
- * @param {Boolean} isPasswordless Whether the captcha is being rendered in a passwordless flow.
91
+ * @param {Flow} flow Which flow the captcha is being rendered in.
68
92
  * @param {boolean} wasInvalid A boolean indicating if the previous captcha was invalid.
69
93
  * @param {Function} [next] A callback.
70
94
  */
71
- function swapCaptcha(id, isPasswordless, wasInvalid, next) {
72
- if (isPasswordless) {
95
+ function swapCaptcha(id, flow, wasInvalid, next) {
96
+ if (flow === Flow.PASSWORD_RESET) {
97
+ return _web_api.default.getPasswordResetChallenge(id, function (err, newCaptcha) {
98
+ if (!err && newCaptcha) {
99
+ (0, _index3.swap)(_index3.updateEntity, 'lock', id, l.setPasswordResetCaptcha, newCaptcha, wasInvalid);
100
+ }
101
+ if (next) {
102
+ next();
103
+ }
104
+ });
105
+ } else if (flow === Flow.PASSWORDLESS) {
73
106
  return _web_api.default.getPasswordlessChallenge(id, function (err, newCaptcha) {
74
107
  if (!err && newCaptcha) {
75
108
  (0, _index3.swap)(_index3.updateEntity, 'lock', id, l.setPasswordlessCaptcha, newCaptcha, wasInvalid);
@@ -78,13 +111,14 @@ function swapCaptcha(id, isPasswordless, wasInvalid, next) {
78
111
  next();
79
112
  }
80
113
  });
114
+ } else {
115
+ return _web_api.default.getChallenge(id, function (err, newCaptcha) {
116
+ if (!err && newCaptcha) {
117
+ (0, _index3.swap)(_index3.updateEntity, 'lock', id, l.setCaptcha, newCaptcha, wasInvalid);
118
+ }
119
+ if (next) {
120
+ next();
121
+ }
122
+ });
81
123
  }
82
- return _web_api.default.getChallenge(id, function (err, newCaptcha) {
83
- if (!err && newCaptcha) {
84
- (0, _index3.swap)(_index3.updateEntity, 'lock', id, l.setCaptcha, newCaptcha, wasInvalid);
85
- }
86
- if (next) {
87
- next();
88
- }
89
- });
90
124
  }
@@ -25,7 +25,7 @@ var _index4 = require("./index");
25
25
  var i18n = _interopRequireWildcard(require("../../i18n"));
26
26
  var _captcha = require("../captcha");
27
27
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
28
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
28
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
29
29
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
30
  function logIn(id) {
31
31
  var needsMFA = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
@@ -38,7 +38,7 @@ function logIn(id) {
38
38
  password: c.getFieldValue(m, 'password')
39
39
  };
40
40
  var fields = [usernameField, 'password'];
41
- var isCaptchaValid = (0, _captcha.setCaptchaParams)(m, params, false, fields);
41
+ var isCaptchaValid = (0, _captcha.setCaptchaParams)(m, params, _captcha.Flow.DEFAULT, fields);
42
42
  if (!isCaptchaValid) {
43
43
  return (0, _captcha.showMissingCaptcha)(m, id);
44
44
  }
@@ -53,7 +53,7 @@ function logIn(id) {
53
53
  }
54
54
  if (error) {
55
55
  var wasInvalid = error && error.code === 'invalid_captcha';
56
- return (0, _captcha.swapCaptcha)(id, false, wasInvalid, next);
56
+ return (0, _captcha.swapCaptcha)(id, _captcha.Flow.DEFAULT, wasInvalid, next);
57
57
  }
58
58
  next();
59
59
  });
@@ -84,7 +84,7 @@ function signUp(id) {
84
84
  password: c.getFieldValue(m, 'password'),
85
85
  autoLogin: (0, _index4.shouldAutoLogin)(m)
86
86
  };
87
- var isCaptchaValid = (0, _captcha.setCaptchaParams)(m, params, false, fields);
87
+ var isCaptchaValid = (0, _captcha.setCaptchaParams)(m, params, _captcha.Flow.DEFAULT, fields);
88
88
  if (!isCaptchaValid) {
89
89
  return (0, _captcha.showMissingCaptcha)(m, id);
90
90
  }
@@ -125,7 +125,7 @@ function signUp(id) {
125
125
  popupHandler._current_popup.kill();
126
126
  }
127
127
  var wasInvalidCaptcha = error && error.code === 'invalid_captcha';
128
- (0, _captcha.swapCaptcha)(id, false, wasInvalidCaptcha, function () {
128
+ (0, _captcha.swapCaptcha)(id, _captcha.Flow.DEFAULT, wasInvalidCaptcha, function () {
129
129
  setTimeout(function () {
130
130
  return signUpError(id, error);
131
131
  }, 250);
@@ -207,7 +207,7 @@ function signUpError(id, error) {
207
207
  }
208
208
  if (errorKey === 'invalid_captcha') {
209
209
  errorMessage = i18n.html(m, ['error', 'login', errorKey]);
210
- return (0, _captcha.swapCaptcha)(id, false, true, function () {
210
+ return (0, _captcha.swapCaptcha)(id, _captcha.Flow.DEFAULT, true, function () {
211
211
  (0, _index.swap)(_index.updateEntity, 'lock', id, l.setSubmitting, false, errorMessage);
212
212
  });
213
213
  }
@@ -229,6 +229,10 @@ function resetPassword(id) {
229
229
  connection: (0, _index4.databaseConnectionName)(m),
230
230
  email: c.getFieldValue(m, 'email')
231
231
  };
232
+ var isCaptchaValid = (0, _captcha.setCaptchaParams)(m, params, _captcha.Flow.PASSWORD_RESET, ['email']);
233
+ if (!isCaptchaValid) {
234
+ return (0, _captcha.showMissingCaptcha)(m, id, _captcha.Flow.PASSWORD_RESET);
235
+ }
232
236
  _web_api.default.resetPassword(id, params, function (error) {
233
237
  if (error) {
234
238
  setTimeout(function () {
@@ -265,8 +269,15 @@ function resetPasswordSuccess(id) {
265
269
  }
266
270
  function resetPasswordError(id, error) {
267
271
  var m = (0, _index.read)(_index.getEntity, 'lock', id);
268
- var errorMessage = i18n.html(m, ['error', 'forgotPassword', error.code]) || i18n.html(m, ['error', 'forgotPassword', 'lock.fallback']);
269
- (0, _index.swap)(_index.updateEntity, 'lock', id, l.setSubmitting, false, errorMessage);
272
+ var key = error.code;
273
+ if (error.code === 'invalid_captcha') {
274
+ var captchaConfig = l.passwordResetCaptcha(m);
275
+ key = captchaConfig.get('provider') === 'recaptcha_v2' || captchaConfig.get('provider') === 'recaptcha_enterprise' ? 'invalid_recaptcha' : 'invalid_captcha';
276
+ }
277
+ var errorMessage = i18n.html(m, ['error', 'forgotPassword', key]) || i18n.html(m, ['error', 'forgotPassword', 'lock.fallback']);
278
+ (0, _captcha.swapCaptcha)(id, _captcha.Flow.PASSWORD_RESET, error.code === 'invalid_captcha', function () {
279
+ (0, _index.swap)(_index.updateEntity, 'lock', id, l.setSubmitting, false, errorMessage);
280
+ });
270
281
  }
271
282
  function showLoginActivity(id) {
272
283
  var fields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['password'];
@@ -43,7 +43,7 @@ var _tenant = require("../../core/tenant");
43
43
  var _enterprise = require("../../connection/enterprise");
44
44
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
45
45
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
46
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
46
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
47
47
  var _dataFns = (0, _data_utils.dataFns)(['database']),
48
48
  get = _dataFns.get,
49
49
  initNS = _dataFns.initNS,
@@ -18,39 +18,38 @@ var _classic = require("../../engine/classic");
18
18
  var _enterprise = require("../enterprise");
19
19
  var _database = require("../database");
20
20
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
21
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
21
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
  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); }
24
24
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
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
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); }; }
27
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
30
28
  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
29
  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; } }
30
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
33
31
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
32
+ 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); }
33
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
34
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
35
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
36
36
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
37
37
  var LoginPane = exports.default = /*#__PURE__*/function (_React$Component) {
38
- _inherits(LoginPane, _React$Component);
39
- var _super = _createSuper(LoginPane);
40
38
  function LoginPane() {
41
39
  var _this;
42
40
  _classCallCheck(this, LoginPane);
43
41
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
44
42
  args[_key] = arguments[_key];
45
43
  }
46
- _this = _super.call.apply(_super, [this].concat(args));
47
- _defineProperty(_assertThisInitialized(_this), "handleDontRememberPasswordClick", function (e) {
44
+ _this = _callSuper(this, LoginPane, [].concat(args));
45
+ _defineProperty(_this, "handleDontRememberPasswordClick", function (e) {
48
46
  e.preventDefault();
49
47
  (0, _actions.showResetPasswordActivity)(l.id(_this.props.lock));
50
48
  });
51
49
  return _this;
52
50
  }
53
- _createClass(LoginPane, [{
51
+ _inherits(LoginPane, _React$Component);
52
+ return _createClass(LoginPane, [{
54
53
  key: "render",
55
54
  value: function render() {
56
55
  var _this$props = this.props,
@@ -90,7 +89,7 @@ var LoginPane = exports.default = /*#__PURE__*/function (_React$Component) {
90
89
  i18n: i18n,
91
90
  lock: lock,
92
91
  onReload: function onReload() {
93
- return (0, _captcha.swapCaptcha)(l.id(lock), false, false);
92
+ return (0, _captcha.swapCaptcha)(l.id(lock), _captcha.Flow.DEFAULT, false);
94
93
  }
95
94
  }) : null;
96
95
  var dontRememberPassword = showForgotPasswordLink && (0, _index.hasScreen)(lock, 'forgotPassword') ? /*#__PURE__*/_react.default.createElement("p", {
@@ -108,7 +107,6 @@ var LoginPane = exports.default = /*#__PURE__*/function (_React$Component) {
108
107
  }), captchaPane, dontRememberPassword);
109
108
  }
110
109
  }]);
111
- return LoginPane;
112
110
  }(_react.default.Component);
113
111
  LoginPane.propTypes = {
114
112
  emailInputPlaceholder: _propTypes.default.string.isRequired,
@@ -12,29 +12,28 @@ var l = _interopRequireWildcard(require("../../core/index"));
12
12
  var _index2 = require("./index");
13
13
  var _actions2 = require("../../core/actions");
14
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
15
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
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; }
18
18
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19
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
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
21
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
22
22
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
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); }; }
23
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
26
24
  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
25
  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; } }
26
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
29
27
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
28
+ 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); }
29
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
30
30
  var LoginSignUpTabs = exports.default = /*#__PURE__*/function (_React$Component) {
31
- _inherits(LoginSignUpTabs, _React$Component);
32
- var _super = _createSuper(LoginSignUpTabs);
33
31
  function LoginSignUpTabs() {
34
32
  _classCallCheck(this, LoginSignUpTabs);
35
- return _super.apply(this, arguments);
33
+ return _callSuper(this, LoginSignUpTabs, arguments);
36
34
  }
37
- _createClass(LoginSignUpTabs, [{
35
+ _inherits(LoginSignUpTabs, _React$Component);
36
+ return _createClass(LoginSignUpTabs, [{
38
37
  key: "render",
39
38
  value: function render() {
40
39
  var _this$props = this.props,
@@ -79,7 +78,6 @@ var LoginSignUpTabs = exports.default = /*#__PURE__*/function (_React$Component)
79
78
  (0, _actions2.closeLock)(l.id(this.props.lock), true);
80
79
  }
81
80
  }]);
82
- return LoginSignUpTabs;
83
81
  }(_react.default.Component);
84
82
  LoginSignUpTabs.propTypes = {
85
83
  lock: _propTypes.default.object.isRequired,
@@ -88,16 +86,14 @@ LoginSignUpTabs.propTypes = {
88
86
  signUpLink: _propTypes.default.string
89
87
  };
90
88
  var LoginSignUpTab = /*#__PURE__*/function (_React$Component2) {
91
- _inherits(LoginSignUpTab, _React$Component2);
92
- var _super2 = _createSuper(LoginSignUpTab);
93
89
  function LoginSignUpTab() {
94
90
  var _this;
95
91
  _classCallCheck(this, LoginSignUpTab);
96
92
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
97
93
  args[_key] = arguments[_key];
98
94
  }
99
- _this = _super2.call.apply(_super2, [this].concat(args));
100
- _defineProperty(_assertThisInitialized(_this), "handleClick", function (e) {
95
+ _this = _callSuper(this, LoginSignUpTab, [].concat(args));
96
+ _defineProperty(_this, "handleClick", function (e) {
101
97
  if (_this.props.href) {
102
98
  _this.props.clickWithHrefHandler();
103
99
  } else {
@@ -107,7 +103,8 @@ var LoginSignUpTab = /*#__PURE__*/function (_React$Component2) {
107
103
  });
108
104
  return _this;
109
105
  }
110
- _createClass(LoginSignUpTab, [{
106
+ _inherits(LoginSignUpTab, _React$Component2);
107
+ return _createClass(LoginSignUpTab, [{
111
108
  key: "render",
112
109
  value: function render() {
113
110
  var _this$props2 = this.props,
@@ -123,5 +120,4 @@ var LoginSignUpTab = /*#__PURE__*/function (_React$Component2) {
123
120
  }, label));
124
121
  }
125
122
  }]);
126
- return LoginSignUpTab;
127
123
  }(_react.default.Component);
@@ -12,23 +12,22 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
12
12
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13
13
  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); } }
14
14
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
15
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
15
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
16
16
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
- 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); }
18
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
19
- 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); }; }
17
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
20
18
  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); }
21
19
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
22
- 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; } }
20
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
23
21
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22
+ 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); }
23
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
24
24
  var MFAPane = exports.default = /*#__PURE__*/function (_React$Component) {
25
- _inherits(MFAPane, _React$Component);
26
- var _super = _createSuper(MFAPane);
27
25
  function MFAPane() {
28
26
  _classCallCheck(this, MFAPane);
29
- return _super.apply(this, arguments);
27
+ return _callSuper(this, MFAPane, arguments);
30
28
  }
31
- _createClass(MFAPane, [{
29
+ _inherits(MFAPane, _React$Component);
30
+ return _createClass(MFAPane, [{
32
31
  key: "render",
33
32
  value: function render() {
34
33
  var _this$props = this.props,
@@ -48,7 +47,6 @@ var MFAPane = exports.default = /*#__PURE__*/function (_React$Component) {
48
47
  return /*#__PURE__*/_react.default.createElement("div", null, titleElement, header, pane);
49
48
  }
50
49
  }]);
51
- return MFAPane;
52
50
  }(_react.default.Component);
53
51
  MFAPane.propTypes = {
54
52
  mfaInputPlaceholder: _propTypes.default.string.isRequired,
@@ -13,29 +13,28 @@ var _actions = require("../../core/actions");
13
13
  var l = _interopRequireWildcard(require("../../core/index"));
14
14
  var i18n = _interopRequireWildcard(require("../../i18n"));
15
15
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
18
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19
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
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
21
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
22
22
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
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); }; }
23
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
26
24
  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
25
  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; } }
26
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
29
27
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
28
+ 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); }
29
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
30
30
  // TODO: can't we get this from props?
31
31
  var PasswordResetConfirmation = exports.default = /*#__PURE__*/function (_React$Component) {
32
- _inherits(PasswordResetConfirmation, _React$Component);
33
- var _super = _createSuper(PasswordResetConfirmation);
34
32
  function PasswordResetConfirmation() {
35
33
  _classCallCheck(this, PasswordResetConfirmation);
36
- return _super.apply(this, arguments);
34
+ return _callSuper(this, PasswordResetConfirmation, arguments);
37
35
  }
38
- _createClass(PasswordResetConfirmation, [{
36
+ _inherits(PasswordResetConfirmation, _React$Component);
37
+ return _createClass(PasswordResetConfirmation, [{
39
38
  key: "handleClose",
40
39
  value: function handleClose() {
41
40
  var _this$props = this.props,
@@ -54,7 +53,6 @@ var PasswordResetConfirmation = exports.default = /*#__PURE__*/function (_React$
54
53
  }, /*#__PURE__*/_react.default.createElement("p", null, i18n.html(this.props.lock, ['success', 'forgotPassword'])));
55
54
  }
56
55
  }]);
57
- return PasswordResetConfirmation;
58
56
  }(_react.default.Component);
59
57
  PasswordResetConfirmation.propTypes = {
60
58
  closeHandler: _propTypes.default.func.isRequired,