@stokr/components-library 2.3.39 → 2.3.40

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.
@@ -50,8 +50,8 @@ var footerGroups = [{
50
50
  name: 'New to STOKR',
51
51
  collapse: true,
52
52
  items: [{
53
- name: 'Products',
54
- url: "".concat(_globalVariables.platformURL, "/products")
53
+ name: 'Solutions',
54
+ url: "".concat(_globalVariables.platformURL, "/solutions")
55
55
  }, {
56
56
  name: '101s',
57
57
  url: "".concat(_globalVariables.platformURL, "/101")
@@ -35,8 +35,8 @@ FooterMenu1.args = {
35
35
  name: 'New to STOKR',
36
36
  collapse: true,
37
37
  items: [{
38
- name: 'Products',
39
- url: 'https://stokr.info/products'
38
+ name: 'Solutions',
39
+ url: 'https://stokr.info/solutions'
40
40
  }, {
41
41
  name: '101s',
42
42
  url: 'https://stokr.info/101'
@@ -761,19 +761,70 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
761
761
  return _ref14.apply(this, arguments);
762
762
  };
763
763
  }());
764
- _defineProperty(_assertThisInitialized(_this), "handleVerifyEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
764
+ _defineProperty(_assertThisInitialized(_this), "checkActivationLinkExpired", /*#__PURE__*/function () {
765
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(actionCode) {
766
+ var actionCodeInfo;
767
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
768
+ while (1) switch (_context15.prev = _context15.next) {
769
+ case 0:
770
+ _context15.prev = 0;
771
+ _context15.next = 3;
772
+ return (0, _auth.checkActionCode)(_firebaseConfig.auth, actionCode);
773
+ case 3:
774
+ actionCodeInfo = _context15.sent;
775
+ return _context15.abrupt("return", {
776
+ expired: false,
777
+ info: actionCodeInfo
778
+ });
779
+ case 7:
780
+ _context15.prev = 7;
781
+ _context15.t0 = _context15["catch"](0);
782
+ console.log('🚀 ~ file: AuthContext.js ~ checkActivationLinkExpired error:', _context15.t0);
783
+
784
+ // If the action code is expired or invalid, we'll get an error
785
+ if (!(_context15.t0.code === 'auth/expired-action-code')) {
786
+ _context15.next = 14;
787
+ break;
788
+ }
789
+ return _context15.abrupt("return", {
790
+ expired: true,
791
+ error: _context15.t0
792
+ });
793
+ case 14:
794
+ if (!(_context15.t0.code === 'auth/invalid-action-code')) {
795
+ _context15.next = 16;
796
+ break;
797
+ }
798
+ return _context15.abrupt("return", {
799
+ expired: false,
800
+ // Not expired but invalid
801
+ error: _context15.t0
802
+ });
803
+ case 16:
804
+ throw _context15.t0;
805
+ case 17:
806
+ case "end":
807
+ return _context15.stop();
808
+ }
809
+ }, _callee15, null, [[0, 7]]);
810
+ }));
811
+ return function (_x18) {
812
+ return _ref15.apply(this, arguments);
813
+ };
814
+ }());
815
+ _defineProperty(_assertThisInitialized(_this), "handleVerifyEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
765
816
  var location, query, oobCode, customToken, email;
766
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
767
- while (1) switch (_context15.prev = _context15.next) {
817
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
818
+ while (1) switch (_context16.prev = _context16.next) {
768
819
  case 0:
769
820
  _this.setState({
770
821
  isVerifyingEmail: true
771
822
  });
772
823
  location = _this.props.location;
773
824
  query = new URLSearchParams(location.search);
774
- _context15.prev = 3;
825
+ _context16.prev = 3;
775
826
  oobCode = query.get('oobCode');
776
- _context15.next = 7;
827
+ _context16.next = 7;
777
828
  return _Auth.default.handleVerifyEmail(oobCode);
778
829
  case 7:
779
830
  _this.setState({
@@ -783,188 +834,188 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
783
834
  if (customToken) {
784
835
  _this.loginUser(null, null, customToken);
785
836
  }
786
- _context15.next = 28;
837
+ _context16.next = 28;
787
838
  break;
788
839
  case 12:
789
- _context15.prev = 12;
790
- _context15.t0 = _context15["catch"](3);
791
- _context15.t1 = _context15.t0 === null || _context15.t0 === void 0 ? void 0 : _context15.t0.code;
792
- _context15.next = _context15.t1 === 'auth/expired-action-code' ? 17 : _context15.t1 === 'auth/invalid-action-code' ? 21 : _context15.t1 === 'auth/user-disabled' ? 23 : 25;
840
+ _context16.prev = 12;
841
+ _context16.t0 = _context16["catch"](3);
842
+ _context16.t1 = _context16.t0 === null || _context16.t0 === void 0 ? void 0 : _context16.t0.code;
843
+ _context16.next = _context16.t1 === 'auth/expired-action-code' ? 17 : _context16.t1 === 'auth/invalid-action-code' ? 21 : _context16.t1 === 'auth/user-disabled' ? 23 : 25;
793
844
  break;
794
845
  case 17:
795
- _context15.t0.message = 'The activation link has expired. We are sending you a new one right now.';
846
+ _context16.t0.message = 'The activation link has expired. We are sending you a new one right now.';
796
847
  email = query.get('email');
797
848
  if (email) {
798
- _context15.t0.email = email;
849
+ _context16.t0.email = email;
799
850
  //Auth.resendActivationEmail(email)
800
851
  }
801
- return _context15.abrupt("break", 26);
852
+ return _context16.abrupt("break", 26);
802
853
  case 21:
803
- _context15.t0.message = 'This link is invalid. Please try verifying email again.';
804
- return _context15.abrupt("break", 26);
854
+ _context16.t0.message = 'This link is invalid. Please try verifying email again.';
855
+ return _context16.abrupt("break", 26);
805
856
  case 23:
806
- _context15.t0.message = 'Your account has been disabled. Please contact our support.';
807
- return _context15.abrupt("break", 26);
857
+ _context16.t0.message = 'Your account has been disabled. Please contact our support.';
858
+ return _context16.abrupt("break", 26);
808
859
  case 25:
809
- return _context15.abrupt("break", 26);
860
+ return _context16.abrupt("break", 26);
810
861
  case 26:
811
- console.log('🚀 ~ file: AuthContext.js:446 ~ error:', _context15.t0);
862
+ console.log('🚀 ~ file: AuthContext.js:446 ~ error:', _context16.t0);
812
863
  _this.setState({
813
- verifyEmailError: _context15.t0,
864
+ verifyEmailError: _context16.t0,
814
865
  isVerifyingEmail: false,
815
866
  isFetchingUser: false
816
867
  });
817
868
  //throw error
818
869
  case 28:
819
870
  case "end":
820
- return _context15.stop();
871
+ return _context16.stop();
821
872
  }
822
- }, _callee15, null, [[3, 12]]);
873
+ }, _callee16, null, [[3, 12]]);
823
874
  })));
824
875
  _defineProperty(_assertThisInitialized(_this), "handleResetPassword", /*#__PURE__*/function () {
825
- var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(password) {
876
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(password) {
826
877
  var location, query, oobCode;
827
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
828
- while (1) switch (_context16.prev = _context16.next) {
878
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
879
+ while (1) switch (_context17.prev = _context17.next) {
829
880
  case 0:
830
881
  location = _this.props.location;
831
- _context16.prev = 1;
882
+ _context17.prev = 1;
832
883
  query = new URLSearchParams(location.search);
833
884
  oobCode = query.get('oobCode');
834
- _context16.next = 6;
885
+ _context17.next = 6;
835
886
  return _Auth.default.handleResetPassword(oobCode, password);
836
887
  case 6:
837
- _context16.next = 21;
888
+ _context17.next = 21;
838
889
  break;
839
890
  case 8:
840
- _context16.prev = 8;
841
- _context16.t0 = _context16["catch"](1);
842
- _context16.t1 = _context16.t0 === null || _context16.t0 === void 0 ? void 0 : _context16.t0.code;
843
- _context16.next = _context16.t1 === 'auth/expired-action-code' ? 13 : _context16.t1 === 'auth/invalid-action-code' ? 15 : _context16.t1 === 'auth/user-disabled' ? 17 : 19;
891
+ _context17.prev = 8;
892
+ _context17.t0 = _context17["catch"](1);
893
+ _context17.t1 = _context17.t0 === null || _context17.t0 === void 0 ? void 0 : _context17.t0.code;
894
+ _context17.next = _context17.t1 === 'auth/expired-action-code' ? 13 : _context17.t1 === 'auth/invalid-action-code' ? 15 : _context17.t1 === 'auth/user-disabled' ? 17 : 19;
844
895
  break;
845
896
  case 13:
846
- _context16.t0.message = 'This link has expired. Please try reseting password again.';
847
- return _context16.abrupt("break", 20);
897
+ _context17.t0.message = 'This link has expired. Please try reseting password again.';
898
+ return _context17.abrupt("break", 20);
848
899
  case 15:
849
- _context16.t0.message = 'This link is invalid. Please try reseting password again.';
850
- return _context16.abrupt("break", 20);
900
+ _context17.t0.message = 'This link is invalid. Please try reseting password again.';
901
+ return _context17.abrupt("break", 20);
851
902
  case 17:
852
- _context16.t0.message = 'Your account has been disabled. Please contact our support.';
853
- return _context16.abrupt("break", 20);
903
+ _context17.t0.message = 'Your account has been disabled. Please contact our support.';
904
+ return _context17.abrupt("break", 20);
854
905
  case 19:
855
- return _context16.abrupt("break", 20);
906
+ return _context17.abrupt("break", 20);
856
907
  case 20:
857
- throw _context16.t0;
908
+ throw _context17.t0;
858
909
  case 21:
859
910
  case "end":
860
- return _context16.stop();
911
+ return _context17.stop();
861
912
  }
862
- }, _callee16, null, [[1, 8]]);
913
+ }, _callee17, null, [[1, 8]]);
863
914
  }));
864
- return function (_x18) {
865
- return _ref16.apply(this, arguments);
915
+ return function (_x19) {
916
+ return _ref17.apply(this, arguments);
866
917
  };
867
918
  }());
868
- _defineProperty(_assertThisInitialized(_this), "sendWelcomeEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
869
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
870
- while (1) switch (_context17.prev = _context17.next) {
919
+ _defineProperty(_assertThisInitialized(_this), "sendWelcomeEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
920
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
921
+ while (1) switch (_context18.prev = _context18.next) {
871
922
  case 0:
872
- _context17.prev = 0;
873
- _context17.next = 3;
923
+ _context18.prev = 0;
924
+ _context18.next = 3;
874
925
  return _Auth.default.sendWelcomeEmail();
875
926
  case 3:
876
- _context17.next = 8;
927
+ _context18.next = 8;
877
928
  break;
878
929
  case 5:
879
- _context17.prev = 5;
880
- _context17.t0 = _context17["catch"](0);
881
- console.log("Error sending welcome email: ".concat(_context17.t0));
930
+ _context18.prev = 5;
931
+ _context18.t0 = _context18["catch"](0);
932
+ console.log("Error sending welcome email: ".concat(_context18.t0));
882
933
  // No need to throw error, let the app continue even if it fails
883
934
  case 8:
884
935
  case "end":
885
- return _context17.stop();
936
+ return _context18.stop();
886
937
  }
887
- }, _callee17, null, [[0, 5]]);
938
+ }, _callee18, null, [[0, 5]]);
888
939
  })));
889
940
  _defineProperty(_assertThisInitialized(_this), "uploaProofOfAddress", /*#__PURE__*/function () {
890
- var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(data, ip) {
941
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(data, ip) {
891
942
  var user;
892
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
893
- while (1) switch (_context18.prev = _context18.next) {
943
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
944
+ while (1) switch (_context19.prev = _context19.next) {
894
945
  case 0:
895
- _context18.prev = 0;
896
- _context18.next = 3;
946
+ _context19.prev = 0;
947
+ _context19.next = 3;
897
948
  return _Auth.default.uploaProofOfAddress(data, ip);
898
949
  case 3:
899
- user = _context18.sent;
950
+ user = _context19.sent;
900
951
  _this.setUser(user);
901
- _context18.next = 11;
952
+ _context19.next = 11;
902
953
  break;
903
954
  case 7:
904
- _context18.prev = 7;
905
- _context18.t0 = _context18["catch"](0);
906
- console.log("Error uploading proof of address: ".concat(_context18.t0));
907
- throw _context18.t0;
955
+ _context19.prev = 7;
956
+ _context19.t0 = _context19["catch"](0);
957
+ console.log("Error uploading proof of address: ".concat(_context19.t0));
958
+ throw _context19.t0;
908
959
  case 11:
909
960
  case "end":
910
- return _context18.stop();
961
+ return _context19.stop();
911
962
  }
912
- }, _callee18, null, [[0, 7]]);
963
+ }, _callee19, null, [[0, 7]]);
913
964
  }));
914
- return function (_x19, _x20) {
915
- return _ref18.apply(this, arguments);
965
+ return function (_x20, _x21) {
966
+ return _ref19.apply(this, arguments);
916
967
  };
917
968
  }());
918
969
  _defineProperty(_assertThisInitialized(_this), "validateGreenWalletId", /*#__PURE__*/function () {
919
- var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(id) {
920
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
921
- while (1) switch (_context19.prev = _context19.next) {
970
+ var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(id) {
971
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
972
+ while (1) switch (_context20.prev = _context20.next) {
922
973
  case 0:
923
- _context19.prev = 0;
924
- _context19.next = 3;
974
+ _context20.prev = 0;
975
+ _context20.next = 3;
925
976
  return _Auth.default.validateGreenWalletId(id);
926
977
  case 3:
927
- return _context19.abrupt("return", _context19.sent);
978
+ return _context20.abrupt("return", _context20.sent);
928
979
  case 6:
929
- _context19.prev = 6;
930
- _context19.t0 = _context19["catch"](0);
931
- console.log("Error validating Green Wallet ID: ".concat(_context19.t0));
932
- throw _context19.t0;
980
+ _context20.prev = 6;
981
+ _context20.t0 = _context20["catch"](0);
982
+ console.log("Error validating Green Wallet ID: ".concat(_context20.t0));
983
+ throw _context20.t0;
933
984
  case 10:
934
985
  case "end":
935
- return _context19.stop();
986
+ return _context20.stop();
936
987
  }
937
- }, _callee19, null, [[0, 6]]);
988
+ }, _callee20, null, [[0, 6]]);
938
989
  }));
939
- return function (_x21) {
940
- return _ref19.apply(this, arguments);
990
+ return function (_x22) {
991
+ return _ref20.apply(this, arguments);
941
992
  };
942
993
  }());
943
994
  _defineProperty(_assertThisInitialized(_this), "createWallet", /*#__PURE__*/function () {
944
- var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(data) {
995
+ var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(data) {
945
996
  var wallet;
946
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
947
- while (1) switch (_context20.prev = _context20.next) {
997
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
998
+ while (1) switch (_context21.prev = _context21.next) {
948
999
  case 0:
949
- _context20.prev = 0;
950
- _context20.next = 3;
1000
+ _context21.prev = 0;
1001
+ _context21.next = 3;
951
1002
  return _Auth.default.createWallet(data);
952
1003
  case 3:
953
- wallet = _context20.sent;
954
- return _context20.abrupt("return", wallet);
1004
+ wallet = _context21.sent;
1005
+ return _context21.abrupt("return", wallet);
955
1006
  case 7:
956
- _context20.prev = 7;
957
- _context20.t0 = _context20["catch"](0);
958
- console.log("Error creating wallet: ".concat(_context20.t0));
959
- throw _context20.t0;
1007
+ _context21.prev = 7;
1008
+ _context21.t0 = _context21["catch"](0);
1009
+ console.log("Error creating wallet: ".concat(_context21.t0));
1010
+ throw _context21.t0;
960
1011
  case 11:
961
1012
  case "end":
962
- return _context20.stop();
1013
+ return _context21.stop();
963
1014
  }
964
- }, _callee20, null, [[0, 7]]);
1015
+ }, _callee21, null, [[0, 7]]);
965
1016
  }));
966
- return function (_x22) {
967
- return _ref20.apply(this, arguments);
1017
+ return function (_x23) {
1018
+ return _ref21.apply(this, arguments);
968
1019
  };
969
1020
  }());
970
1021
  _defineProperty(_assertThisInitialized(_this), "setUser", function (user) {
@@ -976,12 +1027,12 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
976
1027
  });
977
1028
  });
978
1029
  _defineProperty(_assertThisInitialized(_this), "fetchLastTime", /*#__PURE__*/function () {
979
- var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(projectName, page, userId) {
1030
+ var _ref22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(projectName, page, userId) {
980
1031
  var filterBody, response;
981
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
982
- while (1) switch (_context21.prev = _context21.next) {
1032
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
1033
+ while (1) switch (_context22.prev = _context22.next) {
983
1034
  case 0:
984
- _context21.prev = 0;
1035
+ _context22.prev = 0;
985
1036
  filterBody = {
986
1037
  projectName: projectName,
987
1038
  page: page
@@ -989,25 +1040,25 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
989
1040
  if (userId) {
990
1041
  filterBody.userId = userId;
991
1042
  }
992
- _context21.next = 5;
1043
+ _context22.next = 5;
993
1044
  return _Auth.default.fetchTrackingUserLastTime({
994
1045
  filter: filterBody
995
1046
  });
996
1047
  case 5:
997
- response = _context21.sent;
998
- return _context21.abrupt("return", response);
1048
+ response = _context22.sent;
1049
+ return _context22.abrupt("return", response);
999
1050
  case 9:
1000
- _context21.prev = 9;
1001
- _context21.t0 = _context21["catch"](0);
1002
- console.log(' error', _context21.t0);
1051
+ _context22.prev = 9;
1052
+ _context22.t0 = _context22["catch"](0);
1053
+ console.log(' error', _context22.t0);
1003
1054
  case 12:
1004
1055
  case "end":
1005
- return _context21.stop();
1056
+ return _context22.stop();
1006
1057
  }
1007
- }, _callee21, null, [[0, 9]]);
1058
+ }, _callee22, null, [[0, 9]]);
1008
1059
  }));
1009
- return function (_x23, _x24, _x25) {
1010
- return _ref21.apply(this, arguments);
1060
+ return function (_x24, _x25, _x26) {
1061
+ return _ref22.apply(this, arguments);
1011
1062
  };
1012
1063
  }());
1013
1064
  return _this;
@@ -1059,6 +1110,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
1059
1110
  updateFirebaseUser: _Auth.default.updateFirebaseUser,
1060
1111
  handleResetPassword: this.handleResetPassword,
1061
1112
  handleVerifyEmail: this.handleVerifyEmail,
1113
+ checkActivationLinkExpired: this.checkActivationLinkExpired,
1062
1114
  setUser: this.setUser,
1063
1115
  refreshIdToken: _Auth.default.refreshIdToken
1064
1116
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "2.3.39",
3
+ "version": "2.3.40",
4
4
  "description": "STOKR - Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",