@stokr/components-library 2.1.0 → 2.1.2-beta.1

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.
@@ -32,9 +32,8 @@ var stepsNames = ['app', 'connect', 'enter-code'];
32
32
  var Enable2FAFlow = function Enable2FAFlow(_ref) {
33
33
  var showFlow = _ref.showFlow,
34
34
  setShowFlow = _ref.setShowFlow,
35
- _ref$withSuccessPage = _ref.withSuccessPage,
36
- withSuccessPage = _ref$withSuccessPage === void 0 ? false : _ref$withSuccessPage,
37
35
  onSuccess = _ref.onSuccess,
36
+ totpData = _ref.totpData,
38
37
  onRequiresRecentLoginError = _ref.onRequiresRecentLoginError;
39
38
  var _useContext = (0, _react.useContext)(_AuthContext.AuthContext),
40
39
  user = _useContext.user,
@@ -44,30 +43,34 @@ var Enable2FAFlow = function Enable2FAFlow(_ref) {
44
43
  _useState2 = _slicedToArray(_useState, 2),
45
44
  showSuccess = _useState2[0],
46
45
  setshowSuccess = _useState2[1];
47
- var _useState3 = (0, _react.useState)(),
48
- _useState4 = _slicedToArray(_useState3, 2),
49
- totpData = _useState4[0],
50
- settotpData = _useState4[1];
51
- var _useState5 = (0, _react.useState)({
46
+ //const [totpData, settotpData] = useState(totpData)
47
+ var _useState3 = (0, _react.useState)({
52
48
  popup: undefined,
53
49
  message: undefined
54
50
  }),
55
- _useState6 = _slicedToArray(_useState5, 2),
56
- popupError = _useState6[0],
57
- setpopupError = _useState6[1];
58
- (0, _react.useEffect)(function () {
59
- if (user) {
60
- generateTotpSecret(user).then(function (data) {
61
- settotpData(data);
62
- return;
63
- }).catch(function (error) {
64
- console.log(error);
65
- if (error.code === 'auth/requires-recent-login' || error.code === 'auth/unsupported-first-factor') {
66
- onRequiresRecentLoginError && onRequiresRecentLoginError();
67
- }
68
- });
69
- }
70
- }, [user]);
51
+ _useState4 = _slicedToArray(_useState3, 2),
52
+ popupError = _useState4[0],
53
+ setpopupError = _useState4[1];
54
+
55
+ // useEffect(() => {
56
+ // if (user) {
57
+ // generateTotpSecret(user)
58
+ // .then((data) => {
59
+ // settotpData(data)
60
+ // return
61
+ // })
62
+ // .catch((error) => {
63
+ // console.log(error)
64
+ // if (
65
+ // error.code === 'auth/requires-recent-login' ||
66
+ // error.code === 'auth/unsupported-first-factor'
67
+ // ) {
68
+ // onRequiresRecentLoginError && onRequiresRecentLoginError()
69
+ // }
70
+ // })
71
+ // }
72
+ // }, [user])
73
+
71
74
  var onSubmit = /*#__PURE__*/function () {
72
75
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
73
76
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -23,14 +23,14 @@ var _excluded = ["onRequiresRecentLoginError", "open2faflow", "onLoginAgainClick
23
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
24
  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); }
25
25
  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; }
26
- 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; }
27
- 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); } }
28
- 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); }); }; }
29
26
  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
27
  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
28
  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; }
32
29
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
33
30
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
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
+ 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
+ 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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
35
35
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
36
36
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -48,7 +48,8 @@ var Main2FAFlow = function Main2FAFlow(_ref) {
48
48
  var _useContext = (0, _react.useContext)(_AuthContext.AuthContext),
49
49
  user = _useContext.user,
50
50
  checkMfaEnrollment = _useContext.checkMfaEnrollment,
51
- userMfaEnrollment = _useContext.userMfaEnrollment;
51
+ userMfaEnrollment = _useContext.userMfaEnrollment,
52
+ generateTotpSecret = _useContext.generateTotpSecret;
52
53
  var _useState = (0, _react.useState)({
53
54
  enable2fa: open2faflow || false,
54
55
  disable2fa: openDisable2faflow || false,
@@ -65,11 +66,20 @@ var Main2FAFlow = function Main2FAFlow(_ref) {
65
66
  _useState6 = _slicedToArray(_useState5, 2),
66
67
  successMessage = _useState6[0],
67
68
  setsuccessMessage = _useState6[1];
69
+ var _useState7 = (0, _react.useState)(false),
70
+ _useState8 = _slicedToArray(_useState7, 2),
71
+ isLoginRequired = _useState8[0],
72
+ setisLoginRequired = _useState8[1];
73
+ var _useState9 = (0, _react.useState)(),
74
+ _useState10 = _slicedToArray(_useState9, 2),
75
+ totpData = _useState10[0],
76
+ settotpData = _useState10[1];
68
77
  (0, _react.useEffect)(function () {
69
- if (userMfaEnrollment) {
70
- if (userMfaEnrollment.length > 0) setis2FAEnabled(true);
78
+ if ((userMfaEnrollment === null || userMfaEnrollment === void 0 ? void 0 : userMfaEnrollment.length) > 0) {
79
+ setis2FAEnabled(true);
71
80
  } else if (user) {
72
81
  checkMfaEnrollment(user);
82
+ generateTotp();
73
83
  }
74
84
  }, [user, userMfaEnrollment]);
75
85
 
@@ -81,52 +91,88 @@ var Main2FAFlow = function Main2FAFlow(_ref) {
81
91
  }, 5000);
82
92
  }
83
93
  }, [successMessage]);
94
+ var generateTotp = /*#__PURE__*/function () {
95
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
96
+ var response;
97
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
98
+ while (1) switch (_context.prev = _context.next) {
99
+ case 0:
100
+ if (!user) {
101
+ _context.next = 12;
102
+ break;
103
+ }
104
+ _context.prev = 1;
105
+ _context.next = 4;
106
+ return generateTotpSecret(user);
107
+ case 4:
108
+ response = _context.sent;
109
+ console.log('🚀 ~ response:', response);
110
+ settotpData(response);
111
+ _context.next = 12;
112
+ break;
113
+ case 9:
114
+ _context.prev = 9;
115
+ _context.t0 = _context["catch"](1);
116
+ if (_context.t0.code === 'auth/requires-recent-login' || _context.t0.code === 'auth/unsupported-first-factor') {
117
+ setisLoginRequired(true);
118
+ // onRequiresRecentLoginError && onRequiresRecentLoginError()
119
+ }
120
+ case 12:
121
+ case "end":
122
+ return _context.stop();
123
+ }
124
+ }, _callee, null, [[1, 9]]);
125
+ }));
126
+ return function generateTotp() {
127
+ return _ref2.apply(this, arguments);
128
+ };
129
+ }();
84
130
  var switchOpenFlow = function switchOpenFlow(prevFlowId, nextFlowId) {
85
131
  var _objectSpread2;
86
132
  setIsFlowOpen(_objectSpread(_objectSpread({}, isFlowopen), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, prevFlowId, false), _defineProperty(_objectSpread2, nextFlowId, true), _objectSpread2)));
87
133
  };
88
134
  var onEnable2FASuccess = /*#__PURE__*/function () {
89
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
90
- return _regeneratorRuntime().wrap(function _callee$(_context) {
91
- while (1) switch (_context.prev = _context.next) {
135
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
136
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
137
+ while (1) switch (_context2.prev = _context2.next) {
92
138
  case 0:
93
139
  setis2FAEnabled(true);
94
140
  checkMfaEnrollment(user);
95
141
  setsuccessMessage('Your log in 2FA authentication is now set');
96
142
  case 3:
97
143
  case "end":
98
- return _context.stop();
144
+ return _context2.stop();
99
145
  }
100
- }, _callee);
146
+ }, _callee2);
101
147
  }));
102
148
  return function onEnable2FASuccess() {
103
- return _ref2.apply(this, arguments);
149
+ return _ref3.apply(this, arguments);
104
150
  };
105
151
  }();
106
152
  var onDisable2FASuccess = /*#__PURE__*/function () {
107
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
108
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
109
- while (1) switch (_context2.prev = _context2.next) {
153
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
154
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
155
+ while (1) switch (_context3.prev = _context3.next) {
110
156
  case 0:
111
157
  setis2FAEnabled(false);
112
158
  checkMfaEnrollment(user);
113
159
  setsuccessMessage('Your log in 2FA authentication is removed');
114
160
  case 3:
115
161
  case "end":
116
- return _context2.stop();
162
+ return _context3.stop();
117
163
  }
118
- }, _callee2);
164
+ }, _callee3);
119
165
  }));
120
166
  return function onDisable2FASuccess() {
121
- return _ref3.apply(this, arguments);
167
+ return _ref4.apply(this, arguments);
122
168
  };
123
169
  }();
124
170
  var onRequiresRecentLoginErrorHandler = function onRequiresRecentLoginErrorHandler() {
125
- setIsFlowOpen({
126
- requiresRecentLogin: true,
127
- enable2fa: false,
128
- disable2fa: false
129
- });
171
+ // setIsFlowOpen({
172
+ // requiresRecentLogin: true,
173
+ // enable2fa: false,
174
+ // disable2fa: false,
175
+ // })
130
176
  onRequiresRecentLoginError && onRequiresRecentLoginError();
131
177
  };
132
178
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
@@ -152,7 +198,13 @@ var Main2FAFlow = function Main2FAFlow(_ref) {
152
198
  margin: 0
153
199
  },
154
200
  handleChange: function handleChange(value) {
155
- if (value === 'enabled') {
201
+ if (isLoginRequired) {
202
+ setIsFlowOpen({
203
+ requiresRecentLogin: true,
204
+ enable2fa: false,
205
+ disable2fa: false
206
+ });
207
+ } else if (value === 'enabled') {
156
208
  switchOpenFlow('disable2fa', 'enable2fa');
157
209
  } else if (value === 'disabled') {
158
210
  switchOpenFlow('enable2fa', 'disable2fa');
@@ -173,6 +225,7 @@ var Main2FAFlow = function Main2FAFlow(_ref) {
173
225
  enable2fa: value
174
226
  }));
175
227
  },
228
+ totpData: totpData,
176
229
  onRequiresRecentLoginError: onRequiresRecentLoginErrorHandler,
177
230
  onSuccess: onEnable2FASuccess
178
231
  }), isFlowopen.disable2fa && /*#__PURE__*/_react.default.createElement(_disable2faFlow.default, {
@@ -33,5 +33,5 @@ var Template = function Template(args) {
33
33
  var MainFlow = Template.bind({});
34
34
  exports.MainFlow = MainFlow;
35
35
  MainFlow.args = {
36
- open2faflow: true
36
+ //open2faflow: true,
37
37
  };
@@ -13,6 +13,11 @@ var _Select = require("./Select.styles");
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
15
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
+ 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; }
17
+ 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; }
18
+ 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; }
19
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
20
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
21
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
22
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
23
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -99,20 +104,35 @@ var Select = function Select(props) {
99
104
  onChange: onChange,
100
105
  onBlur: onBlur,
101
106
  onFocus: onFocus,
102
- value: options.find(function (option) {
107
+ value: options === null || options === void 0 ? void 0 : options.find(function (option) {
103
108
  return option.value === value;
104
109
  }),
105
110
  placeholder: "",
106
111
  isSearchable: search,
112
+ styles: {
113
+ control: function control() {
114
+ return _Select.SelectControl;
115
+ },
116
+ menu: function menu() {
117
+ return _Select.SelectMenu;
118
+ },
119
+ option: function option() {
120
+ return _Select.SelectOption;
121
+ },
122
+ selectContainer: function selectContainer() {
123
+ return _Select.SelectContainer;
124
+ },
125
+ valueContainer: function valueContainer(baseStyle) {
126
+ return _objectSpread(_objectSpread({}, baseStyle), {}, {
127
+ padding: 0,
128
+ marginLeft: '-2px'
129
+ });
130
+ }
131
+ },
107
132
  components: {
108
- Control: _Select.SelectControl,
109
133
  DropdownIndicator: DropdownIndicator,
110
134
  IndicatorSeparator: null,
111
- Menu: _Select.SelectMenu,
112
- MenuList: SelectMenuListWithScroll,
113
- Option: _Select.SelectOption,
114
- SelectContainer: _Select.SelectContainer,
115
- ValueContainer: _Select.SelectValueContainer
135
+ MenuList: SelectMenuListWithScroll
116
136
  }
117
137
  }));
118
138
  };
@@ -1,62 +1,51 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.SelectWrapper = exports.SelectValueContainer = exports.SelectOption = exports.SelectMenuList = exports.SelectMenu = exports.SelectIcon = exports.SelectControl = exports.SelectContainer = void 0;
7
- var _styledComponents = _interopRequireDefault(require("styled-components"));
8
- var _reactSelect = require("react-select");
8
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
  var _ComponentScroll = require("../ComponentScroll/ComponentScroll.styles");
10
10
  var _ComponentScroll2 = _interopRequireDefault(require("../ComponentScroll/ComponentScroll"));
11
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
11
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- var SelectControl = (0, _styledComponents.default)(_reactSelect.components.Control).withConfig({
13
- displayName: "Selectstyles__SelectControl",
14
- componentId: "sc-1wc1ybn-0"
15
- })(["&&&{z-index:10 !important;position:relative;display:flex;align-items:center;width:100%;height:40px;font-weight:600;font-size:12px;line-height:18px;padding:15px 0;padding-bottom:5px;border-radius:0;box-shadow:none;border:0;border-top:1px solid transparent;border-bottom:1px solid #f0f0f0;color:#202020;background-color:transparent;transition:border-color 0.2s;cursor:pointer;&:hover{box-shadow:none;border-top-color:transparent;border-bottom-color:#0050ca;}&.active{z-index:12 !important;}}"]);
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); }
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; }
15
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
16
+ var SelectControl = (0, _styledComponents.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &&& {\n z-index: 10 !important;\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n height: 40px;\n font-weight: 600;\n font-size: 12px;\n line-height: 18px;\n padding: 15px 0;\n padding-bottom: 5px;\n border-radius: 0;\n box-shadow: none;\n border: 0;\n border-top: 1px solid transparent;\n border-bottom: 1px solid #f0f0f0;\n color: #202020;\n background-color: transparent;\n transition: border-color 0.2s;\n cursor: pointer;\n\n &:hover {\n box-shadow: none;\n border-top-color: transparent;\n border-bottom-color: #0050ca;\n }\n\n &.active {\n z-index: 12 !important;\n }\n }\n"])));
16
17
  exports.SelectControl = SelectControl;
17
- var SelectMenu = (0, _styledComponents.default)(_reactSelect.components.Menu).withConfig({
18
- displayName: "Selectstyles__SelectMenu",
19
- componentId: "sc-1wc1ybn-1"
20
- })(["&&&{margin-top:-1px;border-radius:0;box-shadow:none;border:0;border-top:1px solid #f0f0f0 !important;border-bottom:1px solid #f0f0f0 !important;background-color:#ffffff;}"]);
18
+ var SelectMenu = (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &&& {\n margin-top: -1px;\n border-radius: 0;\n box-shadow: none;\n border: 0;\n border-top: 1px solid #f0f0f0 !important;\n border-bottom: 1px solid #f0f0f0 !important;\n background-color: #ffffff;\n }\n"])));
21
19
  exports.SelectMenu = SelectMenu;
22
20
  var SelectMenuList = (0, _styledComponents.default)(_ComponentScroll2.default).withConfig({
23
21
  displayName: "Selectstyles__SelectMenuList",
24
- componentId: "sc-1wc1ybn-2"
22
+ componentId: "sc-1wc1ybn-0"
25
23
  })(["", "{right:6px;}"], _ComponentScroll.TrackV);
26
24
  exports.SelectMenuList = SelectMenuList;
27
- var SelectOption = (0, _styledComponents.default)(_reactSelect.components.Option).withConfig({
28
- displayName: "Selectstyles__SelectOption",
29
- componentId: "sc-1wc1ybn-3"
30
- })(["&&&{cursor:pointer;padding:8px 0 !important;padding-left:2px !important;font-size:12px;line-height:18px;border:0;background-color:transparent;color:#202020;", " ", " &:hover{background-color:transparent;font-weight:bold;}}"], function (props) {
25
+ var SelectOption = (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n &&& {\n cursor: pointer;\n padding: 8px 0 !important;\n padding-left: 2px !important;\n font-size: 12px;\n line-height: 18px;\n border: 0;\n background-color: transparent;\n color: #202020;\n\n ", "\n\n ", "\n\n &:hover {\n background-color: transparent;\n font-weight: bold;\n }\n }\n"])), function (props) {
31
26
  return props.isFocused && "\n font-weight: bold;\n ";
32
27
  }, function (props) {
33
28
  return props.isSelected && "\n font-weight: bold;\n ";
34
29
  });
35
30
  exports.SelectOption = SelectOption;
36
- var SelectContainer = (0, _styledComponents.default)(_reactSelect.components.SelectContainer).withConfig({
37
- displayName: "Selectstyles__SelectContainer",
38
- componentId: "sc-1wc1ybn-4"
39
- })(["z-index:100;", ""], function (props) {
31
+ var SelectContainer = (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n z-index: 100;\n ", "\n"])), function (props) {
40
32
  return props.selectProps.menuIsOpen && "\n z-index: 150 !important;\n ";
41
33
  });
42
34
  exports.SelectContainer = SelectContainer;
43
- var SelectValueContainer = (0, _styledComponents.default)(_reactSelect.components.ValueContainer).withConfig({
44
- displayName: "Selectstyles__SelectValueContainer",
45
- componentId: "sc-1wc1ybn-5"
46
- })(["&&&{font-family:'Open sans';padding:0;margin-left:-2px;top:-4px;}"]);
35
+ var SelectValueContainer = (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n &&& {\n font-family: 'Open sans';\n padding: 0;\n margin-left: -2px;\n top: -4px;\n }\n"])));
47
36
  exports.SelectValueContainer = SelectValueContainer;
48
37
  var SelectIcon = _styledComponents.default.i.attrs({
49
38
  className: 'ion ion-ios-arrow-down'
50
39
  }).withConfig({
51
40
  displayName: "Selectstyles__SelectIcon",
52
- componentId: "sc-1wc1ybn-6"
41
+ componentId: "sc-1wc1ybn-1"
53
42
  })(["&&&{transition:0.3s transform;transform:rotate(0);", "}"], function (props) {
54
43
  return props.isMenuOpen && "\n transform: rotate(180deg);\n ";
55
44
  });
56
45
  exports.SelectIcon = SelectIcon;
57
46
  var SelectWrapper = _styledComponents.default.div.withConfig({
58
47
  displayName: "Selectstyles__SelectWrapper",
59
- componentId: "sc-1wc1ybn-7"
48
+ componentId: "sc-1wc1ybn-2"
60
49
  })(["display:inline-block;vertical-align:middle;margin-left:24px;", " ", " &&& ", "{height:24px;font-weight:normal;font-size:11px;line-height:18px;padding:3px 0;border-top:1px solid transparent;border-bottom:1px solid transparent;}&&& ", "{left:0;right:0;width:auto;margin:-6px -12px;margin-top:0;box-shadow:0 1px 4px 0 rgba(0,0,0,0.2);border:0;padding:6px 12px;}&&& ", "{top:0;}"], function (props) {
61
50
  return props.minWidth && "\n min-width: ".concat(props.minWidth, ";\n ");
62
51
  }, function (props) {
@@ -102,7 +102,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
102
102
  _context.t0 = _context["catch"](0);
103
103
  console.log('🚀 ~ file: AuthContext.js:56 ~ error:', _context.t0);
104
104
  _context.t1 = _context.t0.code;
105
- _context.next = _context.t1 === 'auth/multi-factor-auth-required' ? 21 : _context.t1 === 'auth/requires-recent-login' ? 23 : _context.t1 === 'auth/invalid-login-credentials' ? 25 : 27;
105
+ _context.next = _context.t1 === 'auth/multi-factor-auth-required' ? 21 : _context.t1 === 'auth/requires-recent-login' ? 23 : _context.t1 === 'auth/invalid-login-credentials' ? 25 : _context.t1 === 'auth/invalid-credential' ? 25 : 27;
106
106
  break;
107
107
  case 21:
108
108
  _this.setState({
@@ -217,7 +217,6 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
217
217
  multiFactorSession,
218
218
  totpSecret,
219
219
  totpUri,
220
- secret,
221
220
  _args4 = arguments;
222
221
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
223
222
  while (1) switch (_context4.prev = _context4.next) {
@@ -232,22 +231,21 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
232
231
  return _auth.TotpMultiFactorGenerator.generateSecret(multiFactorSession);
233
232
  case 7:
234
233
  totpSecret = _context4.sent;
235
- totpUri = totpSecret.generateQrCodeUrl(user.email, appName); // Also display this key:
236
- secret = totpSecret.secretKey;
234
+ totpUri = totpSecret.generateQrCodeUrl(user.email, appName);
237
235
  return _context4.abrupt("return", {
238
236
  totpUri: totpUri,
239
237
  totpSecret: totpSecret
240
238
  });
241
- case 13:
242
- _context4.prev = 13;
239
+ case 12:
240
+ _context4.prev = 12;
243
241
  _context4.t0 = _context4["catch"](1);
244
242
  console.log('🚀 ~ file: AuthContext.js:51 ~ error:', _context4.t0);
245
243
  throw _context4.t0;
246
- case 17:
244
+ case 16:
247
245
  case "end":
248
246
  return _context4.stop();
249
247
  }
250
- }, _callee4, null, [[1, 13]]);
248
+ }, _callee4, null, [[1, 12]]);
251
249
  }));
252
250
  return function (_x8) {
253
251
  return _ref4.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "2.1.0",
3
+ "version": "2.1.2-beta.1",
4
4
  "description": "STOKR - Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",