@stokr/components-library 2.0.6 β 2.0.8
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/2FA/login-with-otp-flow.js +2 -0
- package/dist/components/2FA/main-flow.js +7 -6
- package/dist/components/Header/Header.styles.js +1 -1
- package/dist/components/headerHo/HeaderHo.js +2 -0
- package/dist/context/AuthContext.js +23 -6
- package/dist/index.js +22 -0
- package/package.json +1 -1
|
@@ -217,6 +217,8 @@ var LoginWithOTP = function LoginWithOTP(_ref) {
|
|
|
217
217
|
console.log('π ~ file: login-with-otp-flow.js:129 ~ error:', _context2.t0);
|
|
218
218
|
if ((_context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.code) === 'auth/invalid-verification-code') {
|
|
219
219
|
handleSetPopupError('enter2fa', 'The verification code is not correct. Try again?');
|
|
220
|
+
} else if ((_context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.code) === 'auth/code-expired') {
|
|
221
|
+
handleSetPopupError('enter2fa', 'Time out. Please restart the flow and log in again');
|
|
220
222
|
} else {
|
|
221
223
|
handleSetPopupError('enter2fa', _context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.message);
|
|
222
224
|
}
|
|
@@ -145,13 +145,14 @@ var Main2FAFlow = function Main2FAFlow(_ref) {
|
|
|
145
145
|
switchOpenFlow('enable2fa', 'disable2fa');
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
}))
|
|
149
|
-
alignVertically: true,
|
|
150
|
-
noPaddingHorizontal: true,
|
|
151
|
-
noPaddingTop: true
|
|
152
|
-
}, /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
148
|
+
})), successMessage && /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
153
149
|
small: true,
|
|
154
|
-
success: true
|
|
150
|
+
success: true,
|
|
151
|
+
style: {
|
|
152
|
+
position: 'absolute',
|
|
153
|
+
bottom: 0,
|
|
154
|
+
left: 0
|
|
155
|
+
}
|
|
155
156
|
}, /*#__PURE__*/_react.default.createElement("p", null, successMessage))), isFlowopen.enable2fa && /*#__PURE__*/_react.default.createElement(_enable2faFlow.default, {
|
|
156
157
|
showFlow: isFlowopen.enable2fa,
|
|
157
158
|
setShowFlow: function setShowFlow(value) {
|
|
@@ -26,7 +26,7 @@ exports.StyledSubMenu = StyledSubMenu;
|
|
|
26
26
|
var StyledHeader = _styledComponents.default.header.withConfig({
|
|
27
27
|
displayName: "Headerstyles__StyledHeader",
|
|
28
28
|
componentId: "sc-hifrdy-1"
|
|
29
|
-
})(["z-index:
|
|
29
|
+
})(["z-index:1000;position:relative;color:", ";border-bottom:1px solid rgb(237,237,237);", ""], _colors.default.black, _rwd.default.MLarge(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: ", "px;\n background-color: ", ";\n box-shadow: inset 0 -1px 0 0 ", ";\n\n ", "\n "])), _spacing.default.headerHeight, _colors.default.white, _colors.default.lightGrey, function (props) {
|
|
30
30
|
return props.noFixedPosition && "\n position:initial;\n ";
|
|
31
31
|
}));
|
|
32
32
|
exports.StyledHeader = StyledHeader;
|
|
@@ -449,6 +449,8 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
449
449
|
console.log('π ~ file: HeaderHo.jsx:364 ~ error:', _context2.t0);
|
|
450
450
|
if ((_context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.code) === 'auth/invalid-verification-code') {
|
|
451
451
|
_this2.setPopupError('enter2fa', 'Thatβs not the right 2FA code. Try again');
|
|
452
|
+
} else if ((_context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.code) === 'auth/code-expired') {
|
|
453
|
+
_this2.setPopupError('enter2fa', 'Time out. Please restart the flow and log in again');
|
|
452
454
|
} else {
|
|
453
455
|
_this2.setPopupError('enter2fa', _context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.message);
|
|
454
456
|
}
|
|
@@ -564,7 +564,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
564
564
|
});
|
|
565
565
|
_defineProperty(_assertThisInitialized(_this), "updateUser", /*#__PURE__*/function () {
|
|
566
566
|
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(data) {
|
|
567
|
-
var _yield$Auth$updateUse, user;
|
|
567
|
+
var _yield$Auth$updateUse, user, firebaseUser, _yield$fetchData2, customToken, newUser;
|
|
568
568
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
569
569
|
while (1) switch (_context11.prev = _context11.next) {
|
|
570
570
|
case 0:
|
|
@@ -574,18 +574,35 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
574
574
|
case 3:
|
|
575
575
|
_yield$Auth$updateUse = _context11.sent;
|
|
576
576
|
user = _yield$Auth$updateUse.user;
|
|
577
|
-
_this.
|
|
578
|
-
|
|
577
|
+
firebaseUser = _this.state.firebaseUser;
|
|
578
|
+
if (firebaseUser) {
|
|
579
|
+
_context11.next = 14;
|
|
580
|
+
break;
|
|
581
|
+
}
|
|
582
|
+
_context11.next = 9;
|
|
583
|
+
return (0, _fetchData.default)('auth/get-custom-token');
|
|
579
584
|
case 9:
|
|
580
|
-
|
|
585
|
+
_yield$fetchData2 = _context11.sent;
|
|
586
|
+
customToken = _yield$fetchData2.customToken;
|
|
587
|
+
_context11.next = 13;
|
|
588
|
+
return _Auth.default.signInWithToken(customToken);
|
|
589
|
+
case 13:
|
|
590
|
+
firebaseUser = _context11.sent;
|
|
591
|
+
case 14:
|
|
592
|
+
//merge firebaseUser and our user object
|
|
593
|
+
newUser = _this.patchUserObject(user, firebaseUser);
|
|
594
|
+
_this.setUser(newUser);
|
|
595
|
+
return _context11.abrupt("return", user);
|
|
596
|
+
case 19:
|
|
597
|
+
_context11.prev = 19;
|
|
581
598
|
_context11.t0 = _context11["catch"](0);
|
|
582
599
|
console.log("Error updating the user: ".concat(_context11.t0));
|
|
583
600
|
throw _context11.t0;
|
|
584
|
-
case
|
|
601
|
+
case 23:
|
|
585
602
|
case "end":
|
|
586
603
|
return _context11.stop();
|
|
587
604
|
}
|
|
588
|
-
}, _callee11, null, [[0,
|
|
605
|
+
}, _callee11, null, [[0, 19]]);
|
|
589
606
|
}));
|
|
590
607
|
return function (_x15) {
|
|
591
608
|
return _ref11.apply(this, arguments);
|
package/dist/index.js
CHANGED
|
@@ -278,6 +278,17 @@ Object.keys(_Form).forEach(function (key) {
|
|
|
278
278
|
}
|
|
279
279
|
});
|
|
280
280
|
});
|
|
281
|
+
var _Card = require("./components/Card/Card.styles");
|
|
282
|
+
Object.keys(_Card).forEach(function (key) {
|
|
283
|
+
if (key === "default" || key === "__esModule") return;
|
|
284
|
+
if (key in exports && exports[key] === _Card[key]) return;
|
|
285
|
+
Object.defineProperty(exports, key, {
|
|
286
|
+
enumerable: true,
|
|
287
|
+
get: function get() {
|
|
288
|
+
return _Card[key];
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
});
|
|
281
292
|
var _Grid = require("./components/Grid/Grid.styles");
|
|
282
293
|
Object.keys(_Grid).forEach(function (key) {
|
|
283
294
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -399,6 +410,17 @@ Object.keys(_InputUsername).forEach(function (key) {
|
|
|
399
410
|
}
|
|
400
411
|
});
|
|
401
412
|
});
|
|
413
|
+
var _InputWithButton = require("./components/Input/InputWithButton");
|
|
414
|
+
Object.keys(_InputWithButton).forEach(function (key) {
|
|
415
|
+
if (key === "default" || key === "__esModule") return;
|
|
416
|
+
if (key in exports && exports[key] === _InputWithButton[key]) return;
|
|
417
|
+
Object.defineProperty(exports, key, {
|
|
418
|
+
enumerable: true,
|
|
419
|
+
get: function get() {
|
|
420
|
+
return _InputWithButton[key];
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
});
|
|
402
424
|
var _InvestCalculator = require("./components/InvestCalculator/InvestCalculator");
|
|
403
425
|
Object.keys(_InvestCalculator).forEach(function (key) {
|
|
404
426
|
if (key === "default" || key === "__esModule") return;
|