@stokr/components-library 2.3.41-beta.16 → 2.3.41-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/headerHo/HeaderHo.js +221 -188
- package/dist/utils/customHooks.js +33 -1
- package/package.json +1 -1
|
@@ -26,9 +26,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
26
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
27
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
28
|
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); }
|
|
29
|
+
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; }
|
|
29
30
|
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; }
|
|
30
31
|
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; }
|
|
31
|
-
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; }
|
|
32
32
|
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); } }
|
|
33
33
|
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); }); }; }
|
|
34
34
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -92,71 +92,111 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
92
92
|
},
|
|
93
93
|
isActionLoading: undefined,
|
|
94
94
|
termsData: undefined,
|
|
95
|
-
|
|
96
|
-
forgotPasswordFromExpiredLink: false
|
|
95
|
+
isPasswordResetLinkExpired: false
|
|
97
96
|
});
|
|
98
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
99
|
-
var
|
|
97
|
+
_defineProperty(_assertThisInitialized(_this), "componentDidMount", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
98
|
+
var _this$props, isResetPassword, urlParams, oobCode, tokenStatus;
|
|
100
99
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
101
100
|
while (1) switch (_context.prev = _context.next) {
|
|
102
101
|
case 0:
|
|
103
|
-
|
|
104
|
-
if (
|
|
105
|
-
_context.next =
|
|
102
|
+
_this$props = _this.props, isResetPassword = _this$props.isResetPassword, urlParams = _this$props.urlParams; // check if reset password modal and extract oobCode from URL params
|
|
103
|
+
if (!isResetPassword) {
|
|
104
|
+
_context.next = 15;
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
oobCode = urlParams === null || urlParams === void 0 ? void 0 : urlParams.getUrlParam('oobCode');
|
|
108
|
+
if (!(oobCode && oobCode !== '')) {
|
|
109
|
+
_context.next = 15;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
_context.prev = 4;
|
|
113
|
+
_context.next = 7;
|
|
114
|
+
return _this.checkTokenExpiration();
|
|
115
|
+
case 7:
|
|
116
|
+
tokenStatus = _context.sent;
|
|
117
|
+
_this.setState(function (prevState) {
|
|
118
|
+
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
119
|
+
isPasswordResetLinkExpired: tokenStatus.expired
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
_context.next = 15;
|
|
123
|
+
break;
|
|
124
|
+
case 11:
|
|
125
|
+
_context.prev = 11;
|
|
126
|
+
_context.t0 = _context["catch"](4);
|
|
127
|
+
console.error('Error checking token expiration in componentDidMount:', _context.t0);
|
|
128
|
+
// if there's an error checking the token, assume it's expired
|
|
129
|
+
_this.setState(function (prevState) {
|
|
130
|
+
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
131
|
+
isPasswordResetLinkExpired: true
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
case 15:
|
|
135
|
+
case "end":
|
|
136
|
+
return _context.stop();
|
|
137
|
+
}
|
|
138
|
+
}, _callee, null, [[4, 11]]);
|
|
139
|
+
})));
|
|
140
|
+
_defineProperty(_assertThisInitialized(_this), "checkTokenExpiration", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
141
|
+
var urlParams, oobCode, result;
|
|
142
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
143
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
144
|
+
case 0:
|
|
145
|
+
urlParams = _this.props.urlParams;
|
|
146
|
+
if (urlParams) {
|
|
147
|
+
_context2.next = 3;
|
|
106
148
|
break;
|
|
107
149
|
}
|
|
108
|
-
return
|
|
150
|
+
return _context2.abrupt("return", {
|
|
109
151
|
expired: true
|
|
110
152
|
});
|
|
111
153
|
case 3:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
query = new URLSearchParams(search);
|
|
115
|
-
oobCode = query.get('oobCode');
|
|
154
|
+
_context2.prev = 3;
|
|
155
|
+
oobCode = urlParams.getUrlParam('oobCode');
|
|
116
156
|
if (oobCode) {
|
|
117
|
-
|
|
157
|
+
_context2.next = 7;
|
|
118
158
|
break;
|
|
119
159
|
}
|
|
120
|
-
return
|
|
160
|
+
return _context2.abrupt("return", {
|
|
121
161
|
expired: true
|
|
122
162
|
});
|
|
123
|
-
case
|
|
124
|
-
|
|
163
|
+
case 7:
|
|
164
|
+
_context2.next = 9;
|
|
125
165
|
return _this.context.checkActivationLinkExpired(oobCode);
|
|
126
|
-
case
|
|
127
|
-
result =
|
|
128
|
-
return
|
|
129
|
-
case
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
console.error('Error checking token expiration:',
|
|
133
|
-
return
|
|
166
|
+
case 9:
|
|
167
|
+
result = _context2.sent;
|
|
168
|
+
return _context2.abrupt("return", result);
|
|
169
|
+
case 13:
|
|
170
|
+
_context2.prev = 13;
|
|
171
|
+
_context2.t0 = _context2["catch"](3);
|
|
172
|
+
console.error('Error checking token expiration:', _context2.t0);
|
|
173
|
+
return _context2.abrupt("return", {
|
|
134
174
|
expired: true
|
|
135
175
|
});
|
|
136
|
-
case
|
|
176
|
+
case 17:
|
|
137
177
|
case "end":
|
|
138
|
-
return
|
|
178
|
+
return _context2.stop();
|
|
139
179
|
}
|
|
140
|
-
},
|
|
180
|
+
}, _callee2, null, [[3, 13]]);
|
|
141
181
|
})));
|
|
142
|
-
_defineProperty(_assertThisInitialized(_this), "checkForModals", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
143
|
-
var _this$
|
|
144
|
-
return _regeneratorRuntime().wrap(function
|
|
145
|
-
while (1) switch (
|
|
182
|
+
_defineProperty(_assertThisInitialized(_this), "checkForModals", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
183
|
+
var _this$props2, isLogin, isSignUp, isResetPassword, isVerifyEmail, user, _this$state, isModalOpen, isPasswordResetLinkExpired, login, signUp, resetPassword, verifyEmail, isAnyModalOpen;
|
|
184
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
185
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
146
186
|
case 0:
|
|
147
|
-
_this$
|
|
187
|
+
_this$props2 = _this.props, isLogin = _this$props2.isLogin, isSignUp = _this$props2.isSignUp, isResetPassword = _this$props2.isResetPassword, isVerifyEmail = _this$props2.isVerifyEmail;
|
|
148
188
|
user = _this.context.user;
|
|
149
|
-
isModalOpen = _this.state.
|
|
189
|
+
_this$state = _this.state, isModalOpen = _this$state.isModalOpen, isPasswordResetLinkExpired = _this$state.isPasswordResetLinkExpired;
|
|
150
190
|
login = isModalOpen.login, signUp = isModalOpen.signUp, resetPassword = isModalOpen.resetPassword, verifyEmail = isModalOpen.verifyEmail; //checks if any modal is open
|
|
151
191
|
//if true we won't open any modal from below
|
|
152
192
|
isAnyModalOpen = Object.values(isModalOpen).some(function (value) {
|
|
153
193
|
return value === true;
|
|
154
194
|
});
|
|
155
195
|
if (!isAnyModalOpen) {
|
|
156
|
-
|
|
196
|
+
_context3.next = 7;
|
|
157
197
|
break;
|
|
158
198
|
}
|
|
159
|
-
return
|
|
199
|
+
return _context3.abrupt("return");
|
|
160
200
|
case 7:
|
|
161
201
|
//dont open if modal is already open or user is logged in
|
|
162
202
|
if (isLogin && !user && !login) {
|
|
@@ -177,34 +217,27 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
177
217
|
});
|
|
178
218
|
});
|
|
179
219
|
}
|
|
180
|
-
if (
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
// Open special version of forgot password modal if token is expired
|
|
190
|
-
_this.setState(function (prevState) {
|
|
191
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
192
|
-
isModalOpen: _objectSpread(_objectSpread({}, isModalOpen), {}, {
|
|
193
|
-
forgot: true
|
|
194
|
-
})
|
|
220
|
+
if (isResetPassword && !user && !resetPassword) {
|
|
221
|
+
if (isPasswordResetLinkExpired) {
|
|
222
|
+
// open special version of forgot password modal if token is expired
|
|
223
|
+
_this.setState(function (prevState) {
|
|
224
|
+
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
225
|
+
isModalOpen: _objectSpread(_objectSpread({}, isModalOpen), {}, {
|
|
226
|
+
forgot: true
|
|
227
|
+
})
|
|
228
|
+
});
|
|
195
229
|
});
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
})
|
|
230
|
+
} else {
|
|
231
|
+
// open usual reset password modal if token is valid
|
|
232
|
+
_this.setState(function (prevState) {
|
|
233
|
+
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
234
|
+
isModalOpen: _objectSpread(_objectSpread({}, isModalOpen), {}, {
|
|
235
|
+
resetPassword: true
|
|
236
|
+
})
|
|
237
|
+
});
|
|
204
238
|
});
|
|
205
|
-
}
|
|
239
|
+
}
|
|
206
240
|
}
|
|
207
|
-
case 14:
|
|
208
241
|
if (isVerifyEmail && !verifyEmail) {
|
|
209
242
|
_this.setState(function (prevState) {
|
|
210
243
|
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
@@ -214,17 +247,17 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
214
247
|
});
|
|
215
248
|
});
|
|
216
249
|
}
|
|
217
|
-
case
|
|
250
|
+
case 11:
|
|
218
251
|
case "end":
|
|
219
|
-
return
|
|
252
|
+
return _context3.stop();
|
|
220
253
|
}
|
|
221
|
-
},
|
|
254
|
+
}, _callee3);
|
|
222
255
|
})));
|
|
223
256
|
_defineProperty(_assertThisInitialized(_this), "setOpenModalStatus", function (modalId, status) {
|
|
224
257
|
var isModalOpen = _this.state.isModalOpen;
|
|
225
|
-
var _this$
|
|
226
|
-
onSignupModalClose = _this$
|
|
227
|
-
navigate = _this$
|
|
258
|
+
var _this$props3 = _this.props,
|
|
259
|
+
onSignupModalClose = _this$props3.onSignupModalClose,
|
|
260
|
+
navigate = _this$props3.navigate;
|
|
228
261
|
|
|
229
262
|
//if we pass custom onSignupModalClose, we don't want any modification in the url
|
|
230
263
|
if (!onSignupModalClose) {
|
|
@@ -349,20 +382,20 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
349
382
|
key: "render",
|
|
350
383
|
value: function render() {
|
|
351
384
|
var _this2 = this;
|
|
352
|
-
var _this$
|
|
353
|
-
isModalOpen = _this$
|
|
354
|
-
userInfo = _this$
|
|
355
|
-
isActionLoading = _this$
|
|
356
|
-
termsData = _this$
|
|
357
|
-
var _this$
|
|
358
|
-
fixed = _this$
|
|
359
|
-
activateMenu = _this$
|
|
360
|
-
activeMenu = _this$
|
|
361
|
-
withoutLoginSignupButton = _this$
|
|
362
|
-
useRelativePathForMenu = _this$
|
|
363
|
-
isLoginModalOpen = _this$
|
|
364
|
-
setIsLoginModalOpen = _this$
|
|
365
|
-
cooldown = _this$
|
|
385
|
+
var _this$state2 = this.state,
|
|
386
|
+
isModalOpen = _this$state2.isModalOpen,
|
|
387
|
+
userInfo = _this$state2.userInfo,
|
|
388
|
+
isActionLoading = _this$state2.isActionLoading,
|
|
389
|
+
termsData = _this$state2.termsData;
|
|
390
|
+
var _this$props4 = this.props,
|
|
391
|
+
fixed = _this$props4.fixed,
|
|
392
|
+
activateMenu = _this$props4.activateMenu,
|
|
393
|
+
activeMenu = _this$props4.activeMenu,
|
|
394
|
+
withoutLoginSignupButton = _this$props4.withoutLoginSignupButton,
|
|
395
|
+
useRelativePathForMenu = _this$props4.useRelativePathForMenu,
|
|
396
|
+
isLoginModalOpen = _this$props4.isLoginModalOpen,
|
|
397
|
+
setIsLoginModalOpen = _this$props4.setIsLoginModalOpen,
|
|
398
|
+
cooldown = _this$props4.cooldown;
|
|
366
399
|
var _this$context2 = this.context,
|
|
367
400
|
getUser = _this$context2.getUser,
|
|
368
401
|
_this$context2$user = _this$context2.user,
|
|
@@ -418,47 +451,47 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
418
451
|
_this2.setIsActionLoading(undefined);
|
|
419
452
|
},
|
|
420
453
|
onFormSend: /*#__PURE__*/function () {
|
|
421
|
-
var
|
|
454
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref5) {
|
|
422
455
|
var email, password, errorMessage;
|
|
423
|
-
return _regeneratorRuntime().wrap(function
|
|
424
|
-
while (1) switch (
|
|
456
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
457
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
425
458
|
case 0:
|
|
426
|
-
email =
|
|
459
|
+
email = _ref5.email, password = _ref5.password;
|
|
427
460
|
_this2.clearPopupError();
|
|
428
461
|
_this2.setIsActionLoading('login');
|
|
429
|
-
|
|
462
|
+
_context4.prev = 3;
|
|
430
463
|
if (!(password.length > 128)) {
|
|
431
|
-
|
|
464
|
+
_context4.next = 8;
|
|
432
465
|
break;
|
|
433
466
|
}
|
|
434
467
|
_this2.setPopupError('login', 'Your password cannot exceed 128 characters');
|
|
435
468
|
_this2.setIsActionLoading(undefined);
|
|
436
|
-
return
|
|
469
|
+
return _context4.abrupt("return");
|
|
437
470
|
case 8:
|
|
438
|
-
|
|
471
|
+
_context4.next = 10;
|
|
439
472
|
return loginUser(email, password);
|
|
440
473
|
case 10:
|
|
441
|
-
|
|
474
|
+
_context4.next = 12;
|
|
442
475
|
return getUser();
|
|
443
476
|
case 12:
|
|
444
477
|
_this2.setOpenModalStatus('login', false);
|
|
445
478
|
setIsLoginModalOpen && setIsLoginModalOpen(false);
|
|
446
479
|
_this2.clearPopupError();
|
|
447
480
|
_this2.setIsActionLoading(undefined);
|
|
448
|
-
|
|
481
|
+
_context4.next = 28;
|
|
449
482
|
break;
|
|
450
483
|
case 18:
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
errorMessage =
|
|
454
|
-
if (!((
|
|
455
|
-
|
|
484
|
+
_context4.prev = 18;
|
|
485
|
+
_context4.t0 = _context4["catch"](3);
|
|
486
|
+
errorMessage = _context4.t0 === null || _context4.t0 === void 0 ? void 0 : _context4.t0.message; //handle switch modal correctly
|
|
487
|
+
if (!((_context4.t0 === null || _context4.t0 === void 0 ? void 0 : _context4.t0.code) === 'auth/multi-factor-auth-required')) {
|
|
488
|
+
_context4.next = 26;
|
|
456
489
|
break;
|
|
457
490
|
}
|
|
458
491
|
_this2.switchOpenModal('login', 'enter2fa');
|
|
459
492
|
_this2.clearPopupError();
|
|
460
493
|
_this2.setIsActionLoading(undefined);
|
|
461
|
-
return
|
|
494
|
+
return _context4.abrupt("return");
|
|
462
495
|
case 26:
|
|
463
496
|
if (errorMessage) {
|
|
464
497
|
_this2.setPopupError('login', errorMessage);
|
|
@@ -468,12 +501,12 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
468
501
|
_this2.setIsActionLoading(undefined);
|
|
469
502
|
case 28:
|
|
470
503
|
case "end":
|
|
471
|
-
return
|
|
504
|
+
return _context4.stop();
|
|
472
505
|
}
|
|
473
|
-
},
|
|
506
|
+
}, _callee4, null, [[3, 18]]);
|
|
474
507
|
}));
|
|
475
508
|
return function (_x) {
|
|
476
|
-
return
|
|
509
|
+
return _ref6.apply(this, arguments);
|
|
477
510
|
};
|
|
478
511
|
}()
|
|
479
512
|
}), waitingFor2fa && /*#__PURE__*/_react.default.createElement(_FA.EnterCode, {
|
|
@@ -492,46 +525,46 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
492
525
|
_this2.setIsActionLoading(undefined);
|
|
493
526
|
},
|
|
494
527
|
onFormSend: /*#__PURE__*/function () {
|
|
495
|
-
var
|
|
528
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref7) {
|
|
496
529
|
var otpInput;
|
|
497
|
-
return _regeneratorRuntime().wrap(function
|
|
498
|
-
while (1) switch (
|
|
530
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
531
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
499
532
|
case 0:
|
|
500
|
-
otpInput =
|
|
533
|
+
otpInput = _ref7.otpInput;
|
|
501
534
|
_this2.setIsActionLoading('enter2fa');
|
|
502
|
-
|
|
503
|
-
|
|
535
|
+
_context5.prev = 2;
|
|
536
|
+
_context5.next = 5;
|
|
504
537
|
return loginUserWithTotp(otpInput, firebaseError);
|
|
505
538
|
case 5:
|
|
506
|
-
|
|
539
|
+
_context5.next = 7;
|
|
507
540
|
return getUser();
|
|
508
541
|
case 7:
|
|
509
542
|
_this2.setOpenModalStatus('enter2fa', false);
|
|
510
543
|
_this2.clearPopupError();
|
|
511
544
|
_this2.setIsActionLoading(undefined);
|
|
512
|
-
|
|
545
|
+
_context5.next = 16;
|
|
513
546
|
break;
|
|
514
547
|
case 12:
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
console.log('🚀 ~ file: HeaderHo.jsx:364 ~ error:',
|
|
518
|
-
if ((
|
|
519
|
-
_this2.setPopupError('enter2fa', '
|
|
520
|
-
} else if ((
|
|
548
|
+
_context5.prev = 12;
|
|
549
|
+
_context5.t0 = _context5["catch"](2);
|
|
550
|
+
console.log('🚀 ~ file: HeaderHo.jsx:364 ~ error:', _context5.t0);
|
|
551
|
+
if ((_context5.t0 === null || _context5.t0 === void 0 ? void 0 : _context5.t0.code) === 'auth/invalid-verification-code') {
|
|
552
|
+
_this2.setPopupError('enter2fa', "That's not the right 2FA code. Try again");
|
|
553
|
+
} else if ((_context5.t0 === null || _context5.t0 === void 0 ? void 0 : _context5.t0.code) === 'auth/code-expired') {
|
|
521
554
|
_this2.setPopupError('enter2fa', 'Time out. Please restart the flow and log in again');
|
|
522
555
|
} else {
|
|
523
|
-
_this2.setPopupError('enter2fa',
|
|
556
|
+
_this2.setPopupError('enter2fa', _context5.t0 === null || _context5.t0 === void 0 ? void 0 : _context5.t0.message);
|
|
524
557
|
}
|
|
525
558
|
case 16:
|
|
526
559
|
_this2.setIsActionLoading(undefined);
|
|
527
560
|
case 17:
|
|
528
561
|
case "end":
|
|
529
|
-
return
|
|
562
|
+
return _context5.stop();
|
|
530
563
|
}
|
|
531
|
-
},
|
|
564
|
+
}, _callee5, null, [[2, 12]]);
|
|
532
565
|
}));
|
|
533
566
|
return function (_x2) {
|
|
534
|
-
return
|
|
567
|
+
return _ref8.apply(this, arguments);
|
|
535
568
|
};
|
|
536
569
|
}()
|
|
537
570
|
}), /*#__PURE__*/_react.default.createElement(_FA.ResetCode, {
|
|
@@ -586,24 +619,24 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
586
619
|
onSignupModalClose && onSignupModalClose();
|
|
587
620
|
},
|
|
588
621
|
onFormSend: /*#__PURE__*/function () {
|
|
589
|
-
var
|
|
590
|
-
return _regeneratorRuntime().wrap(function
|
|
591
|
-
while (1) switch (
|
|
622
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(userInfo) {
|
|
623
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
624
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
592
625
|
case 0:
|
|
593
626
|
_this2.clearPopupError();
|
|
594
627
|
_this2.setIsActionLoading('signUp');
|
|
595
628
|
|
|
596
629
|
//check password
|
|
597
|
-
|
|
630
|
+
_context6.prev = 2;
|
|
598
631
|
if (!(userInfo.password.length > 128)) {
|
|
599
|
-
|
|
632
|
+
_context6.next = 7;
|
|
600
633
|
break;
|
|
601
634
|
}
|
|
602
635
|
_this2.setPopupError('register', 'Your password cannot exceed 128 characters', 'password');
|
|
603
636
|
_this2.setIsActionLoading(undefined);
|
|
604
|
-
return
|
|
637
|
+
return _context6.abrupt("return");
|
|
605
638
|
case 7:
|
|
606
|
-
|
|
639
|
+
_context6.next = 9;
|
|
607
640
|
return createUser(userInfo.email, userInfo.password);
|
|
608
641
|
case 9:
|
|
609
642
|
//start the timer to count when user can resend email
|
|
@@ -611,10 +644,10 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
611
644
|
|
|
612
645
|
//if user checked newsletter checkbox
|
|
613
646
|
if (!userInfo.newsletter) {
|
|
614
|
-
|
|
647
|
+
_context6.next = 13;
|
|
615
648
|
break;
|
|
616
649
|
}
|
|
617
|
-
|
|
650
|
+
_context6.next = 13;
|
|
618
651
|
return (0, _fetchDataPublic.default)('emails/subscribe', {
|
|
619
652
|
email: userInfo.email,
|
|
620
653
|
listName: 'newsletter'
|
|
@@ -623,28 +656,28 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
623
656
|
_this2.setUserInfo(userInfo);
|
|
624
657
|
_this2.switchOpenModal('signUp', 'confirm');
|
|
625
658
|
_this2.setIsActionLoading(undefined);
|
|
626
|
-
|
|
659
|
+
_context6.next = 23;
|
|
627
660
|
break;
|
|
628
661
|
case 18:
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
console.log(
|
|
662
|
+
_context6.prev = 18;
|
|
663
|
+
_context6.t0 = _context6["catch"](2);
|
|
664
|
+
console.log(_context6.t0);
|
|
632
665
|
_this2.setIsActionLoading(undefined);
|
|
633
|
-
if ((
|
|
666
|
+
if ((_context6.t0 === null || _context6.t0 === void 0 ? void 0 : _context6.t0.code) === 'auth/email-already-in-use') {
|
|
634
667
|
_this2.setPopupError('register', 'This email address is already taken', 'email');
|
|
635
|
-
} else if ((
|
|
668
|
+
} else if ((_context6.t0 === null || _context6.t0 === void 0 ? void 0 : _context6.t0.code) === 'auth/weak-password') {
|
|
636
669
|
_this2.setPopupError('register', 'The password is too weak. Please try again.', 'password');
|
|
637
670
|
} else {
|
|
638
671
|
_this2.setPopupError('register', 'Oops, something went wrong');
|
|
639
672
|
}
|
|
640
673
|
case 23:
|
|
641
674
|
case "end":
|
|
642
|
-
return
|
|
675
|
+
return _context6.stop();
|
|
643
676
|
}
|
|
644
|
-
},
|
|
677
|
+
}, _callee6, null, [[2, 18]]);
|
|
645
678
|
}));
|
|
646
679
|
return function (_x3) {
|
|
647
|
-
return
|
|
680
|
+
return _ref9.apply(this, arguments);
|
|
648
681
|
};
|
|
649
682
|
}()
|
|
650
683
|
}), /*#__PURE__*/_react.default.createElement(_TermsModal.default, {
|
|
@@ -670,35 +703,35 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
670
703
|
_this2.clearPopupError();
|
|
671
704
|
_this2.setIsActionLoading(undefined);
|
|
672
705
|
},
|
|
673
|
-
onResend: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
706
|
+
onResend: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
674
707
|
var email;
|
|
675
|
-
return _regeneratorRuntime().wrap(function
|
|
676
|
-
while (1) switch (
|
|
708
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
709
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
677
710
|
case 0:
|
|
678
711
|
_this2.clearPopupSuccess();
|
|
679
712
|
_this2.clearPopupError();
|
|
680
713
|
_this2.setIsActionLoading('resend');
|
|
681
|
-
|
|
714
|
+
_context7.prev = 3;
|
|
682
715
|
email = _this2.state.userInfo.email;
|
|
683
|
-
|
|
716
|
+
_context7.next = 7;
|
|
684
717
|
return resendActivationEmail(email);
|
|
685
718
|
case 7:
|
|
686
719
|
cooldown === null || cooldown === void 0 || cooldown.startCooldown();
|
|
687
720
|
_this2.setPopupSuccess('resend', 'Email sent.');
|
|
688
721
|
_this2.setIsActionLoading(undefined);
|
|
689
|
-
|
|
722
|
+
_context7.next = 17;
|
|
690
723
|
break;
|
|
691
724
|
case 12:
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
console.log(
|
|
725
|
+
_context7.prev = 12;
|
|
726
|
+
_context7.t0 = _context7["catch"](3);
|
|
727
|
+
console.log(_context7.t0);
|
|
695
728
|
_this2.setPopupError('resend', 'Something went wrong.');
|
|
696
729
|
_this2.setIsActionLoading(undefined);
|
|
697
730
|
case 17:
|
|
698
731
|
case "end":
|
|
699
|
-
return
|
|
732
|
+
return _context7.stop();
|
|
700
733
|
}
|
|
701
|
-
},
|
|
734
|
+
}, _callee7, null, [[3, 12]]);
|
|
702
735
|
}))
|
|
703
736
|
}), /*#__PURE__*/_react.default.createElement(_ForgotPasswordModal.default, {
|
|
704
737
|
isActionLoading: isActionLoading,
|
|
@@ -718,38 +751,38 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
718
751
|
_this2.setIsActionLoading(undefined);
|
|
719
752
|
},
|
|
720
753
|
onFormSend: /*#__PURE__*/function () {
|
|
721
|
-
var
|
|
754
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_ref11) {
|
|
722
755
|
var email;
|
|
723
|
-
return _regeneratorRuntime().wrap(function
|
|
724
|
-
while (1) switch (
|
|
756
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
757
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
725
758
|
case 0:
|
|
726
|
-
email =
|
|
759
|
+
email = _ref11.email;
|
|
727
760
|
_this2.clearPopupError();
|
|
728
761
|
_this2.setIsActionLoading('forgot');
|
|
729
|
-
|
|
730
|
-
|
|
762
|
+
_context8.prev = 3;
|
|
763
|
+
_context8.next = 6;
|
|
731
764
|
return (0, _auth.default)('forgotPass', {
|
|
732
765
|
email: email
|
|
733
766
|
});
|
|
734
767
|
case 6:
|
|
735
768
|
_this2.setPopupSuccess('forgot', "We sent a message to ".concat(email, " (you might need to check your junk or spam folder) \u2014 tap the link inside to create a new password."));
|
|
736
769
|
_this2.setIsActionLoading(undefined);
|
|
737
|
-
|
|
770
|
+
_context8.next = 15;
|
|
738
771
|
break;
|
|
739
772
|
case 10:
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
console.log(
|
|
773
|
+
_context8.prev = 10;
|
|
774
|
+
_context8.t0 = _context8["catch"](3);
|
|
775
|
+
console.log(_context8.t0);
|
|
743
776
|
_this2.setPopupError('forgot', 'This email is not registered.');
|
|
744
777
|
_this2.setIsActionLoading(undefined);
|
|
745
778
|
case 15:
|
|
746
779
|
case "end":
|
|
747
|
-
return
|
|
780
|
+
return _context8.stop();
|
|
748
781
|
}
|
|
749
|
-
},
|
|
782
|
+
}, _callee8, null, [[3, 10]]);
|
|
750
783
|
}));
|
|
751
784
|
return function (_x4) {
|
|
752
|
-
return
|
|
785
|
+
return _ref12.apply(this, arguments);
|
|
753
786
|
};
|
|
754
787
|
}()
|
|
755
788
|
}), /*#__PURE__*/_react.default.createElement(_ResetPasswordModal.default, {
|
|
@@ -768,36 +801,36 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
768
801
|
_this2.setIsActionLoading(undefined);
|
|
769
802
|
},
|
|
770
803
|
onFormSend: /*#__PURE__*/function () {
|
|
771
|
-
var
|
|
804
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_ref13) {
|
|
772
805
|
var password, oobCode;
|
|
773
|
-
return _regeneratorRuntime().wrap(function
|
|
774
|
-
while (1) switch (
|
|
806
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
807
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
775
808
|
case 0:
|
|
776
|
-
password =
|
|
809
|
+
password = _ref13.password, oobCode = _ref13.oobCode;
|
|
777
810
|
_this2.clearPopupError();
|
|
778
811
|
_this2.setIsActionLoading('resetPassword');
|
|
779
|
-
|
|
780
|
-
|
|
812
|
+
_context9.prev = 3;
|
|
813
|
+
_context9.next = 6;
|
|
781
814
|
return handleResetPassword(password, oobCode);
|
|
782
815
|
case 6:
|
|
783
816
|
_this2.switchOpenModal('resetPassword', 'confirmReset');
|
|
784
817
|
_this2.setIsActionLoading(undefined);
|
|
785
|
-
|
|
818
|
+
_context9.next = 15;
|
|
786
819
|
break;
|
|
787
820
|
case 10:
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
console.log(
|
|
791
|
-
_this2.setPopupError('resetPassword', (
|
|
821
|
+
_context9.prev = 10;
|
|
822
|
+
_context9.t0 = _context9["catch"](3);
|
|
823
|
+
console.log(_context9.t0);
|
|
824
|
+
_this2.setPopupError('resetPassword', (_context9.t0 === null || _context9.t0 === void 0 ? void 0 : _context9.t0.message) || 'Something went wrong.');
|
|
792
825
|
_this2.setIsActionLoading(undefined);
|
|
793
826
|
case 15:
|
|
794
827
|
case "end":
|
|
795
|
-
return
|
|
828
|
+
return _context9.stop();
|
|
796
829
|
}
|
|
797
|
-
},
|
|
830
|
+
}, _callee9, null, [[3, 10]]);
|
|
798
831
|
}));
|
|
799
832
|
return function (_x5) {
|
|
800
|
-
return
|
|
833
|
+
return _ref14.apply(this, arguments);
|
|
801
834
|
};
|
|
802
835
|
}()
|
|
803
836
|
}), /*#__PURE__*/_react.default.createElement(_ResetConfirmModal.default, {
|
|
@@ -836,37 +869,37 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
836
869
|
_this2.setIsActionLoading(undefined);
|
|
837
870
|
},
|
|
838
871
|
onResend: /*#__PURE__*/function () {
|
|
839
|
-
var
|
|
872
|
+
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(values) {
|
|
840
873
|
var email;
|
|
841
|
-
return _regeneratorRuntime().wrap(function
|
|
842
|
-
while (1) switch (
|
|
874
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
875
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
843
876
|
case 0:
|
|
844
877
|
_this2.clearPopupSuccess();
|
|
845
878
|
_this2.clearPopupError();
|
|
846
879
|
_this2.setIsActionLoading('resend');
|
|
847
|
-
|
|
880
|
+
_context10.prev = 3;
|
|
848
881
|
email = values === null || values === void 0 ? void 0 : values.email;
|
|
849
|
-
|
|
882
|
+
_context10.next = 7;
|
|
850
883
|
return resendActivationEmail(email);
|
|
851
884
|
case 7:
|
|
852
885
|
_this2.setPopupSuccess('resend', 'Email sent.');
|
|
853
886
|
_this2.setIsActionLoading(undefined);
|
|
854
|
-
|
|
887
|
+
_context10.next = 16;
|
|
855
888
|
break;
|
|
856
889
|
case 11:
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
console.log(
|
|
860
|
-
_this2.setPopupError('resend', (
|
|
890
|
+
_context10.prev = 11;
|
|
891
|
+
_context10.t0 = _context10["catch"](3);
|
|
892
|
+
console.log(_context10.t0);
|
|
893
|
+
_this2.setPopupError('resend', (_context10.t0 === null || _context10.t0 === void 0 ? void 0 : _context10.t0.message) || 'Something went wrong.');
|
|
861
894
|
_this2.setIsActionLoading(undefined);
|
|
862
895
|
case 16:
|
|
863
896
|
case "end":
|
|
864
|
-
return
|
|
897
|
+
return _context10.stop();
|
|
865
898
|
}
|
|
866
|
-
},
|
|
899
|
+
}, _callee10, null, [[3, 11]]);
|
|
867
900
|
}));
|
|
868
901
|
return function (_x6) {
|
|
869
|
-
return
|
|
902
|
+
return _ref15.apply(this, arguments);
|
|
870
903
|
};
|
|
871
904
|
}()
|
|
872
905
|
}));
|
|
@@ -876,7 +909,7 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
876
909
|
}(_react.Component);
|
|
877
910
|
_defineProperty(HeaderHoClass, "propTypes", {});
|
|
878
911
|
_defineProperty(HeaderHoClass, "contextType", _AuthContext.AuthContext);
|
|
879
|
-
var HeaderHo = (0, _withRouter.withRouter)((0, _customHooks.cooldownHOC)(HeaderHoClass, 90));
|
|
912
|
+
var HeaderHo = (0, _withRouter.withRouter)((0, _customHooks.cooldownHOC)((0, _customHooks.withUrlParams)(HeaderHoClass), 90));
|
|
880
913
|
exports.HeaderHo = HeaderHo;
|
|
881
914
|
var _default = HeaderHo;
|
|
882
915
|
exports.default = _default;
|
|
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.useMobileView = exports.useCooldown = exports.cooldownHOC = void 0;
|
|
8
8
|
exports.usePrevious = usePrevious;
|
|
9
|
+
exports.withUrlParams = exports.useUrlParams = void 0;
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _rwd = _interopRequireWildcard(require("../styles/rwd"));
|
|
12
|
+
var _reactRouterDom = require("react-router-dom");
|
|
11
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
15
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -116,4 +118,34 @@ var cooldownHOC = function cooldownHOC(Component) {
|
|
|
116
118
|
};
|
|
117
119
|
return Wrapper;
|
|
118
120
|
};
|
|
119
|
-
exports.cooldownHOC = cooldownHOC;
|
|
121
|
+
exports.cooldownHOC = cooldownHOC;
|
|
122
|
+
var useUrlParams = function useUrlParams() {
|
|
123
|
+
var location = (0, _reactRouterDom.useLocation)();
|
|
124
|
+
var getUrlParam = function getUrlParam(paramName) {
|
|
125
|
+
var searchParams = new URLSearchParams(location.search);
|
|
126
|
+
return searchParams.get(paramName);
|
|
127
|
+
};
|
|
128
|
+
var getAllParams = function getAllParams() {
|
|
129
|
+
var searchParams = new URLSearchParams(location.search);
|
|
130
|
+
return Object.fromEntries(searchParams.entries());
|
|
131
|
+
};
|
|
132
|
+
return {
|
|
133
|
+
location: location,
|
|
134
|
+
pathname: location.pathname,
|
|
135
|
+
search: location.search,
|
|
136
|
+
getUrlParam: getUrlParam,
|
|
137
|
+
getAllParams: getAllParams
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// HOC to inject URL data
|
|
142
|
+
exports.useUrlParams = useUrlParams;
|
|
143
|
+
var withUrlParams = function withUrlParams(Component) {
|
|
144
|
+
return function (props) {
|
|
145
|
+
var urlParams = useUrlParams();
|
|
146
|
+
return /*#__PURE__*/_react.default.createElement(Component, _extends({}, props, {
|
|
147
|
+
urlParams: urlParams
|
|
148
|
+
}));
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
exports.withUrlParams = withUrlParams;
|