@stokr/components-library 2.0.0-beta.8 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/api/fetchData.js +6 -5
  2. package/dist/components/2FA/Connect2FA.js +23 -18
  3. package/dist/components/2FA/EnterCode.js +5 -10
  4. package/dist/components/2FA/InstallAuthApp.js +3 -3
  5. package/dist/components/2FA/ResetCode.js +11 -4
  6. package/dist/components/2FA/Sucess2FA.js +29 -16
  7. package/dist/components/2FA/disable-2fa-flow.js +45 -140
  8. package/dist/components/2FA/enable-2fa-flow.js +30 -19
  9. package/dist/components/2FA/login-with-otp-flow.js +10 -2
  10. package/dist/components/2FA/main-flow.js +25 -9
  11. package/dist/components/2FA/main-flow.stories.js +1 -1
  12. package/dist/components/CryptoAddress/CryptoAddress.js +7 -4
  13. package/dist/components/Footer/Footer.js +4 -4
  14. package/dist/components/Footer/Footer.styles.js +18 -13
  15. package/dist/components/ForgotPasswordModal/ForgotPasswordModal.stories.js +4 -1
  16. package/dist/components/Grid/Grid.styles.js +9 -2
  17. package/dist/components/Header/Header.js +16 -9
  18. package/dist/components/Header/Header.styles.js +2 -2
  19. package/dist/components/InfoIcon/InfoIcon.js +11 -2
  20. package/dist/components/Input/OtpInput.js +3 -2
  21. package/dist/components/LoginModal/LoginModal.js +9 -8
  22. package/dist/components/LoginModal/LoginModal.stories.js +8 -0
  23. package/dist/components/MainMenu/MainMenu.js +6 -16
  24. package/dist/components/MainMenu/MainMenu.styles.js +1 -1
  25. package/dist/components/RegisterConfirmModal/RegisterConfirmModal.js +10 -3
  26. package/dist/components/RegisterConfirmModal/RegisterConfirmModal.stories.js +6 -2
  27. package/dist/components/RegisterModal/RegisterModal.js +4 -5
  28. package/dist/components/ResetConfirmModal/ResetConfirmModal.styles.js +2 -3
  29. package/dist/components/Switch/Switch.js +16 -6
  30. package/dist/components/Switch/Switch.styles.js +3 -3
  31. package/dist/components/TextLink/TextLink.styles.js +4 -2
  32. package/dist/components/VerifyEmailModal/VerifyEmailModal.js +159 -0
  33. package/dist/components/VerifyEmailModal/VerifyEmailModal.stories.js +64 -0
  34. package/dist/components/headerHo/HeaderHo.js +119 -38
  35. package/dist/components/headerHo/HeaderHo.stories.js +6 -1
  36. package/dist/constants/globalVariables.js +23 -2
  37. package/dist/context/Auth.js +17 -24
  38. package/dist/context/AuthContext.js +334 -300
  39. package/dist/firebase-config.js +1 -0
  40. package/dist/index.js +11 -0
  41. package/dist/static/images/avatar-placeholder.png +0 -0
  42. package/dist/utils/check-sale-time-left.js +120 -0
  43. package/dist/utils/customHooks.js +60 -2
  44. package/package.json +1 -1
@@ -15,12 +15,14 @@ var _ForgotPasswordModal = _interopRequireDefault(require("../ForgotPasswordModa
15
15
  var _ResetPasswordModal = _interopRequireDefault(require("../ResetPasswordModal/ResetPasswordModal"));
16
16
  var _ResetConfirmModal = _interopRequireDefault(require("../ResetConfirmModal/ResetConfirmModal"));
17
17
  var _LoginModal = _interopRequireDefault(require("../LoginModal/LoginModal"));
18
+ var _VerifyEmailModal = _interopRequireDefault(require("../VerifyEmailModal/VerifyEmailModal"));
18
19
  var _Header = _interopRequireDefault(require("../Header/Header"));
19
20
  var _FA = require("../2FA");
20
21
  var _auth = _interopRequireDefault(require("../../api/auth"));
21
22
  var _fetchDataPublic = _interopRequireDefault(require("../../api/fetchDataPublic"));
22
23
  var _AuthContext = require("../../context/AuthContext");
23
24
  var _withRouter = require("../../utils/withRouter");
25
+ var _customHooks = require("../../utils/customHooks");
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
27
  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); }
26
28
  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; }
@@ -71,7 +73,8 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
71
73
  resetPassword: false,
72
74
  confirmReset: false,
73
75
  enter2fa: false,
74
- resetCode: false
76
+ resetCode: false,
77
+ verifyEmail: false
75
78
  },
76
79
  userInfo: {
77
80
  email: undefined,
@@ -95,12 +98,14 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
95
98
  var _this$props = _this.props,
96
99
  isLogin = _this$props.isLogin,
97
100
  isSignUp = _this$props.isSignUp,
98
- isResetPassword = _this$props.isResetPassword;
101
+ isResetPassword = _this$props.isResetPassword,
102
+ isVerifyEmail = _this$props.isVerifyEmail;
99
103
  var user = _this.context.user;
100
104
  var isModalOpen = _this.state.isModalOpen;
101
105
  var login = isModalOpen.login,
102
106
  signUp = isModalOpen.signUp,
103
- resetPassword = isModalOpen.resetPassword;
107
+ resetPassword = isModalOpen.resetPassword,
108
+ verifyEmail = isModalOpen.verifyEmail;
104
109
 
105
110
  //checks if any modal is open
106
111
  //if true we won't open any modal from below
@@ -108,7 +113,6 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
108
113
  return value === true;
109
114
  });
110
115
  if (isAnyModalOpen) return;
111
- console.log('🚀 ~ file: HeaderHo.jsx:102 ~ this.props:', _this.props);
112
116
 
113
117
  //dont open if modal is already open or user is logged in
114
118
  if (isLogin && !user && !login) {
@@ -138,6 +142,15 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
138
142
  });
139
143
  });
140
144
  }
145
+ if (isVerifyEmail && !verifyEmail) {
146
+ _this.setState(function (prevState) {
147
+ return _objectSpread(_objectSpread({}, prevState), {}, {
148
+ isModalOpen: _objectSpread(_objectSpread({}, isModalOpen), {}, {
149
+ verifyEmail: true
150
+ })
151
+ });
152
+ });
153
+ }
141
154
  });
142
155
  _defineProperty(_assertThisInitialized(_this), "setOpenModalStatus", function (modalId, status) {
143
156
  var isModalOpen = _this.state.isModalOpen;
@@ -151,7 +164,7 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
151
164
  window.history.pushState('', '', modalId === 'login' ? '/login' : modalId === 'signUp' ? '/signup' : '/');
152
165
 
153
166
  //when we close login or signup or reset password modal, we want to remove modal url
154
- if ((modalId === 'login' || modalId === 'signUp' || modalId === 'resetPassword') && !status) {
167
+ if ((modalId === 'login' || modalId === 'signUp' || modalId === 'resetPassword' || modalId === 'verifyEmail') && !status) {
155
168
  navigate('/');
156
169
  }
157
170
  }
@@ -246,8 +259,7 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
246
259
  var mobileMenuOpen = this.state.mobileMenuOpen;
247
260
  var _this$context = this.context,
248
261
  isFetchingUser = _this$context.isFetchingUser,
249
- user = _this$context.user;
250
- var isUserLogged = !!user;
262
+ verifyEmailError = _this$context.verifyEmailError;
251
263
  if (!mobileMenuOpen) {
252
264
  if (isOpenCurrent) {
253
265
  document.body.style.overflow = 'hidden';
@@ -255,9 +267,13 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
255
267
  document.body.style.overflow = 'unset';
256
268
  }
257
269
  }
270
+ if ((verifyEmailError === null || verifyEmailError === void 0 ? void 0 : verifyEmailError.code) === 'auth/invalid-action-code' && !window.location.href.includes('login')) {
271
+ this.props.navigate('/login');
272
+ this.props.navigate(0);
273
+ }
258
274
 
259
- // Run after page loaded, if user is not logged in
260
- if (!isFetchingUser && !isUserLogged) {
275
+ // Run after page loaded
276
+ if (!isFetchingUser) {
261
277
  this.checkForModals();
262
278
  }
263
279
  }
@@ -277,7 +293,8 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
277
293
  withoutLoginSignupButton = _this$props3.withoutLoginSignupButton,
278
294
  useRelativePathForMenu = _this$props3.useRelativePathForMenu,
279
295
  isLoginModalOpen = _this$props3.isLoginModalOpen,
280
- setIsLoginModalOpen = _this$props3.setIsLoginModalOpen;
296
+ setIsLoginModalOpen = _this$props3.setIsLoginModalOpen,
297
+ cooldown = _this$props3.cooldown;
281
298
  var _this$context2 = this.context,
282
299
  getUser = _this$context2.getUser,
283
300
  _this$context2$user = _this$context2.user,
@@ -289,7 +306,10 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
289
306
  firebaseError = _this$context2.firebaseError,
290
307
  loginUserWithTotp = _this$context2.loginUserWithTotp,
291
308
  createUser = _this$context2.createUser,
292
- handleResetPassword = _this$context2.handleResetPassword;
309
+ handleResetPassword = _this$context2.handleResetPassword,
310
+ resendActivationEmail = _this$context2.resendActivationEmail,
311
+ verifyEmailError = _this$context2.verifyEmailError,
312
+ isVerifyingEmail = _this$context2.isVerifyingEmail;
293
313
  return /*#__PURE__*/_react.default.createElement(Outer, {
294
314
  fixed: fixed
295
315
  }, /*#__PURE__*/_react.default.createElement(_Header.default, {
@@ -350,13 +370,13 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
350
370
  _context.next = 10;
351
371
  return loginUser(email, password);
352
372
  case 10:
373
+ _context.next = 12;
374
+ return getUser();
375
+ case 12:
353
376
  _this2.setOpenModalStatus('login', false);
354
377
  setIsLoginModalOpen && setIsLoginModalOpen(false);
355
378
  _this2.clearPopupError();
356
379
  _this2.setIsActionLoading(undefined);
357
- _context.next = 16;
358
- return getUser();
359
- case 16:
360
380
  _context.next = 28;
361
381
  break;
362
382
  case 18:
@@ -418,24 +438,27 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
418
438
  _context2.next = 7;
419
439
  return getUser();
420
440
  case 7:
421
- _context2.next = 13;
441
+ _this2.setOpenModalStatus('enter2fa', false);
442
+ _this2.clearPopupError();
443
+ _this2.setIsActionLoading(undefined);
444
+ _context2.next = 16;
422
445
  break;
423
- case 9:
424
- _context2.prev = 9;
446
+ case 12:
447
+ _context2.prev = 12;
425
448
  _context2.t0 = _context2["catch"](2);
426
449
  console.log('🚀 ~ file: HeaderHo.jsx:364 ~ error:', _context2.t0);
427
450
  if ((_context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.code) === 'auth/invalid-verification-code') {
428
- _this2.setPopupError('enter2fa', 'The verification code is not correct. Try again?');
451
+ _this2.setPopupError('enter2fa', 'That’s not the right 2FA code. Try again');
429
452
  } else {
430
453
  _this2.setPopupError('enter2fa', _context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.message);
431
454
  }
432
- case 13:
455
+ case 16:
433
456
  _this2.setIsActionLoading(undefined);
434
- case 14:
457
+ case 17:
435
458
  case "end":
436
459
  return _context2.stop();
437
460
  }
438
- }, _callee2, null, [[2, 9]]);
461
+ }, _callee2, null, [[2, 12]]);
439
462
  }));
440
463
  return function (_x2) {
441
464
  return _ref5.apply(this, arguments);
@@ -513,23 +536,27 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
513
536
  _context3.next = 9;
514
537
  return createUser(userInfo.email, userInfo.password);
515
538
  case 9:
539
+ //start the timer to count when user can resend email
540
+ cooldown === null || cooldown === void 0 || cooldown.startCooldown();
541
+
542
+ //if user checked newsletter checkbox
516
543
  if (!userInfo.newsletter) {
517
- _context3.next = 12;
544
+ _context3.next = 13;
518
545
  break;
519
546
  }
520
- _context3.next = 12;
547
+ _context3.next = 13;
521
548
  return (0, _fetchDataPublic.default)('emails/subscribe', {
522
549
  email: userInfo.email,
523
550
  listName: 'newsletter'
524
551
  });
525
- case 12:
552
+ case 13:
526
553
  _this2.setUserInfo(userInfo);
527
554
  _this2.switchOpenModal('signUp', 'confirm');
528
555
  _this2.setIsActionLoading(undefined);
529
- _context3.next = 22;
556
+ _context3.next = 23;
530
557
  break;
531
- case 17:
532
- _context3.prev = 17;
558
+ case 18:
559
+ _context3.prev = 18;
533
560
  _context3.t0 = _context3["catch"](2);
534
561
  console.log(_context3.t0);
535
562
  _this2.setIsActionLoading(undefined);
@@ -540,11 +567,11 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
540
567
  } else {
541
568
  _this2.setPopupError('register', 'Oops, something went wrong');
542
569
  }
543
- case 22:
570
+ case 23:
544
571
  case "end":
545
572
  return _context3.stop();
546
573
  }
547
- }, _callee3, null, [[2, 17]]);
574
+ }, _callee3, null, [[2, 18]]);
548
575
  }));
549
576
  return function (_x3) {
550
577
  return _ref6.apply(this, arguments);
@@ -563,6 +590,7 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
563
590
  id: "form-submitted-popup",
564
591
  isActionLoading: isActionLoading,
565
592
  userInfo: userInfo,
593
+ cooldown: cooldown,
566
594
  popupError: this.state.popupError,
567
595
  popupSuccess: this.state.popupSuccess,
568
596
  isModalOpen: isModalOpen.confirm,
@@ -583,25 +611,24 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
583
611
  _context4.prev = 3;
584
612
  email = _this2.state.userInfo.email;
585
613
  _context4.next = 7;
586
- return (0, _auth.default)('forgotPass', {
587
- email: email
588
- });
614
+ return resendActivationEmail(email);
589
615
  case 7:
616
+ cooldown === null || cooldown === void 0 || cooldown.startCooldown();
590
617
  _this2.setPopupSuccess('resend', 'Email sent.');
591
618
  _this2.setIsActionLoading(undefined);
592
- _context4.next = 16;
619
+ _context4.next = 17;
593
620
  break;
594
- case 11:
595
- _context4.prev = 11;
621
+ case 12:
622
+ _context4.prev = 12;
596
623
  _context4.t0 = _context4["catch"](3);
597
624
  console.log(_context4.t0);
598
625
  _this2.setPopupError('resend', 'Something went wrong.');
599
626
  _this2.setIsActionLoading(undefined);
600
- case 16:
627
+ case 17:
601
628
  case "end":
602
629
  return _context4.stop();
603
630
  }
604
- }, _callee4, null, [[3, 11]]);
631
+ }, _callee4, null, [[3, 12]]);
605
632
  }))
606
633
  }), /*#__PURE__*/_react.default.createElement(_ForgotPasswordModal.default, {
607
634
  isActionLoading: isActionLoading,
@@ -714,6 +741,60 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
714
741
  onModalSwitch: function onModalSwitch() {
715
742
  _this2.switchOpenModal('confirmReset', 'login');
716
743
  }
744
+ }), !isVerifyingEmail && /*#__PURE__*/_react.default.createElement(_VerifyEmailModal.default, {
745
+ id: "verify-email-popup",
746
+ isActionLoading: isActionLoading,
747
+ popupError: this.state.popupError,
748
+ popupSuccess: this.state.popupSuccess,
749
+ isModalOpen: isModalOpen.verifyEmail,
750
+ continueUrl: "https://signup.".concat(process.env.REACT_APP_WEBSITE_DOMAIN, "/welcome"),
751
+ error: verifyEmailError,
752
+ isSuccess: !!!verifyEmailError,
753
+ onModalSwitch: function onModalSwitch() {
754
+ _this2.switchOpenModal('verifyEmail', 'login');
755
+ _this2.clearPopupError();
756
+ _this2.setIsActionLoading(undefined);
757
+ },
758
+ onModalClose: function onModalClose() {
759
+ _this2.setOpenModalStatus('verifyEmail', false);
760
+ _this2.clearPopupSuccess();
761
+ _this2.clearPopupError();
762
+ _this2.setIsActionLoading(undefined);
763
+ },
764
+ onResend: /*#__PURE__*/function () {
765
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(values) {
766
+ var email;
767
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
768
+ while (1) switch (_context7.prev = _context7.next) {
769
+ case 0:
770
+ _this2.clearPopupSuccess();
771
+ _this2.clearPopupError();
772
+ _this2.setIsActionLoading('resend');
773
+ _context7.prev = 3;
774
+ email = values === null || values === void 0 ? void 0 : values.email;
775
+ _context7.next = 7;
776
+ return resendActivationEmail(email);
777
+ case 7:
778
+ _this2.setPopupSuccess('resend', 'Email sent.');
779
+ _this2.setIsActionLoading(undefined);
780
+ _context7.next = 16;
781
+ break;
782
+ case 11:
783
+ _context7.prev = 11;
784
+ _context7.t0 = _context7["catch"](3);
785
+ console.log(_context7.t0);
786
+ _this2.setPopupError('resend', (_context7.t0 === null || _context7.t0 === void 0 ? void 0 : _context7.t0.message) || 'Something went wrong.');
787
+ _this2.setIsActionLoading(undefined);
788
+ case 16:
789
+ case "end":
790
+ return _context7.stop();
791
+ }
792
+ }, _callee7, null, [[3, 11]]);
793
+ }));
794
+ return function (_x6) {
795
+ return _ref12.apply(this, arguments);
796
+ };
797
+ }()
717
798
  }));
718
799
  }
719
800
  }]);
@@ -721,7 +802,7 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
721
802
  }(_react.Component);
722
803
  _defineProperty(HeaderHoClass, "propTypes", {});
723
804
  _defineProperty(HeaderHoClass, "contextType", _AuthContext.AuthContext);
724
- var HeaderHo = (0, _withRouter.withRouter)(HeaderHoClass);
805
+ var HeaderHo = (0, _withRouter.withRouter)((0, _customHooks.cooldownHOC)(HeaderHoClass, 90));
725
806
  exports.HeaderHo = HeaderHo;
726
807
  var _default = HeaderHo;
727
808
  exports.default = _default;
@@ -27,7 +27,12 @@ var _default = {
27
27
  };
28
28
  exports.default = _default;
29
29
  var Template = function Template(args) {
30
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, null, /*#__PURE__*/_react.default.createElement(_AuthContext.AuthProvider, null, /*#__PURE__*/_react.default.createElement(_HeaderHo.default, args))));
30
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, null, /*#__PURE__*/_react.default.createElement(_AuthContext.AuthProvider, null, /*#__PURE__*/_react.default.createElement(_HeaderHo.default, args), /*#__PURE__*/_react.default.createElement("div", {
31
+ style: {
32
+ height: '1700px',
33
+ background: 'orange'
34
+ }
35
+ }))));
31
36
  };
32
37
  var HeaderHoOverview = Template.bind({});
33
38
  exports.HeaderHoOverview = HeaderHoOverview;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.walletTypes = exports.platformURL = exports.platformDomain = void 0;
6
+ exports.walletTypes = exports.platformURL = exports.platformDomain = exports.ProjectTypes = exports.ProjectStatus = exports.ProjectStates = void 0;
7
7
  var platformDomain = process.env.REACT_APP_WEBSITE_DOMAIN;
8
8
  exports.platformDomain = platformDomain;
9
9
  var platformURL = 'https://' + platformDomain;
@@ -13,4 +13,25 @@ var walletTypes = {
13
13
  ALGORAND: 'algorand',
14
14
  ETHEREUM: 'ethereum'
15
15
  };
16
- exports.walletTypes = walletTypes;
16
+ exports.walletTypes = walletTypes;
17
+ var ProjectTypes = {
18
+ FUND: 'fund',
19
+ COMPANY: 'company',
20
+ TRANCHES: 'tranches'
21
+ };
22
+ exports.ProjectTypes = ProjectTypes;
23
+ var ProjectStatus = {
24
+ ACTIVE: 'Active',
25
+ INACTIVE: 'Inactive',
26
+ ON_HOLD: 'On_hold'
27
+ };
28
+ exports.ProjectStatus = ProjectStatus;
29
+ var ProjectStates = {
30
+ ON_HOLD: 'ON HOLD',
31
+ LIVE: 'LIVE',
32
+ OPEN: 'OPEN',
33
+ CLOSED: 'CLOSED',
34
+ CLOSED_SUCCESSFULLY: 'CLOSED SUCCESSFULLY',
35
+ UPCOMING: 'UPCOMING'
36
+ };
37
+ exports.ProjectStates = ProjectStates;
@@ -48,7 +48,6 @@ var Auth = /*#__PURE__*/function () {
48
48
  value: function login(email, password) {
49
49
  return new Promise(function (resolve, reject) {
50
50
  (0, _auth.signInWithEmailAndPassword)(_firebaseConfig.auth, email, password).then(function (userCredential) {
51
- // Signed in
52
51
  var user = userCredential.user;
53
52
  resolve(user);
54
53
  }).catch(function (error) {
@@ -81,18 +80,11 @@ var Auth = /*#__PURE__*/function () {
81
80
  });
82
81
  }
83
82
  }, {
84
- key: "activateUser",
85
- value: function activateUser() {
86
- var isUsingQueryParam = window.location.href.includes('?token=');
87
- var token;
88
- if (isUsingQueryParam) {
89
- token = window.location.href.split('activateUser?token=')[1].split('&')[0];
90
- } else {
91
- token = window.location.href.split('activateUser/')[1].split('/')[0];
92
- }
83
+ key: "resendActivationEmail",
84
+ value: function resendActivationEmail(email) {
93
85
  return new Promise(function (resolve, reject) {
94
- _axios.default.post("auth/activate", {
95
- token: token
86
+ _axios.default.post("auth/resend-activation-email", {
87
+ email: email
96
88
  }).then(function (response) {
97
89
  resolve(response.data);
98
90
  }).catch(function (err) {
@@ -104,7 +96,6 @@ var Auth = /*#__PURE__*/function () {
104
96
  key: "handleVerifyEmail",
105
97
  value: function handleVerifyEmail(actionCode, continueUrl) {
106
98
  return new Promise(function (resolve, reject) {
107
- // Try to apply the email verification code.
108
99
  (0, _auth.applyActionCode)(_firebaseConfig.auth, actionCode).then(function (resp) {
109
100
  // Email address has been verified.
110
101
  resolve(resp);
@@ -162,6 +153,19 @@ var Auth = /*#__PURE__*/function () {
162
153
  });
163
154
  });
164
155
  }
156
+ }, {
157
+ key: "signInWithToken",
158
+ value: function signInWithToken(token) {
159
+ return new Promise(function (resolve, reject) {
160
+ (0, _auth.signInWithCustomToken)(_firebaseConfig.auth, token).then(function (userCredential) {
161
+ // Signed in
162
+ var user = userCredential.user;
163
+ resolve(user);
164
+ }).catch(function (error) {
165
+ reject(error);
166
+ });
167
+ });
168
+ }
165
169
  }, {
166
170
  key: "updateUserPassword",
167
171
  value: function updateUserPassword(user, newPassword) {
@@ -261,17 +265,6 @@ var Auth = /*#__PURE__*/function () {
261
265
  });
262
266
  });
263
267
  }
264
- }, {
265
- key: "resendActivationEmail",
266
- value: function resendActivationEmail(data) {
267
- return new Promise(function (resolve, reject) {
268
- _axios.default.post("auth/forgotPass", data).then(function () {
269
- resolve();
270
- }).catch(function (err) {
271
- reject(err);
272
- });
273
- });
274
- }
275
268
  }, {
276
269
  key: "uploaProofOfAddress",
277
270
  value: function uploaProofOfAddress(data, ip) {