@stokr/components-library 2.3.41-beta.19 → 2.3.41-beta.20
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/Footer/FooterMenu.styles.js +1 -1
- package/dist/components/ForgotPasswordModal/ForgotPasswordModal.js +13 -4
- package/dist/components/LoginModal/LoginModal.js +2 -2
- package/dist/components/RegisterModal/RegisterModal.js +3 -4
- package/dist/components/VerifyEmailModal/VerifyEmailModal.js +2 -1
- package/dist/components/headerHo/HeaderHo.js +196 -207
- package/dist/constants/globalVariables.js +6 -2
- package/dist/context/AuthContext.js +113 -150
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.walletTypes = exports.platformURL = exports.platformDomain = exports.UserTypes = exports.ProjectTypes = exports.ProjectStatus = exports.ProjectStates = void 0;
|
|
6
|
+
exports.walletTypes = exports.platformURL = exports.platformDomain = exports.emailRegex = exports.UserTypes = 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;
|
|
@@ -37,4 +37,8 @@ var UserTypes = {
|
|
|
37
37
|
investor: 'investor',
|
|
38
38
|
investor_entity: 'investor_entity'
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
// should be used for all email form validation globally
|
|
42
|
+
exports.UserTypes = UserTypes;
|
|
43
|
+
var emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i;
|
|
44
|
+
exports.emailRegex = emailRegex;
|
|
@@ -761,55 +761,19 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
761
761
|
return _ref14.apply(this, arguments);
|
|
762
762
|
};
|
|
763
763
|
}());
|
|
764
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
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
|
-
if (!(_context15.t0.code === 'auth/expired-action-code' || _context15.t0.code === 'auth/invalid-action-code')) {
|
|
783
|
-
_context15.next = 11;
|
|
784
|
-
break;
|
|
785
|
-
}
|
|
786
|
-
return _context15.abrupt("return", {
|
|
787
|
-
expired: true,
|
|
788
|
-
error: _context15.t0
|
|
789
|
-
});
|
|
790
|
-
case 11:
|
|
791
|
-
case "end":
|
|
792
|
-
return _context15.stop();
|
|
793
|
-
}
|
|
794
|
-
}, _callee15, null, [[0, 7]]);
|
|
795
|
-
}));
|
|
796
|
-
return function (_x18) {
|
|
797
|
-
return _ref15.apply(this, arguments);
|
|
798
|
-
};
|
|
799
|
-
}());
|
|
800
|
-
_defineProperty(_assertThisInitialized(_this), "handleVerifyEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
764
|
+
_defineProperty(_assertThisInitialized(_this), "handleVerifyEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
801
765
|
var location, query, oobCode, customToken, email;
|
|
802
|
-
return _regeneratorRuntime().wrap(function
|
|
803
|
-
while (1) switch (
|
|
766
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
767
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
804
768
|
case 0:
|
|
805
769
|
_this.setState({
|
|
806
770
|
isVerifyingEmail: true
|
|
807
771
|
});
|
|
808
772
|
location = _this.props.location;
|
|
809
773
|
query = new URLSearchParams(location.search);
|
|
810
|
-
|
|
774
|
+
_context15.prev = 3;
|
|
811
775
|
oobCode = query.get('oobCode');
|
|
812
|
-
|
|
776
|
+
_context15.next = 7;
|
|
813
777
|
return _Auth.default.handleVerifyEmail(oobCode);
|
|
814
778
|
case 7:
|
|
815
779
|
_this.setState({
|
|
@@ -819,188 +783,188 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
819
783
|
if (customToken) {
|
|
820
784
|
_this.loginUser(null, null, customToken);
|
|
821
785
|
}
|
|
822
|
-
|
|
786
|
+
_context15.next = 28;
|
|
823
787
|
break;
|
|
824
788
|
case 12:
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
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;
|
|
829
793
|
break;
|
|
830
794
|
case 17:
|
|
831
|
-
|
|
795
|
+
_context15.t0.message = 'The activation link has expired. We are sending you a new one right now.';
|
|
832
796
|
email = query.get('email');
|
|
833
797
|
if (email) {
|
|
834
|
-
|
|
798
|
+
_context15.t0.email = email;
|
|
835
799
|
//Auth.resendActivationEmail(email)
|
|
836
800
|
}
|
|
837
|
-
return
|
|
801
|
+
return _context15.abrupt("break", 26);
|
|
838
802
|
case 21:
|
|
839
|
-
|
|
840
|
-
return
|
|
803
|
+
_context15.t0.message = 'This link is invalid. Please try verifying email again.';
|
|
804
|
+
return _context15.abrupt("break", 26);
|
|
841
805
|
case 23:
|
|
842
|
-
|
|
843
|
-
return
|
|
806
|
+
_context15.t0.message = 'Your account has been disabled. Please contact our support.';
|
|
807
|
+
return _context15.abrupt("break", 26);
|
|
844
808
|
case 25:
|
|
845
|
-
return
|
|
809
|
+
return _context15.abrupt("break", 26);
|
|
846
810
|
case 26:
|
|
847
|
-
console.log('🚀 ~ file: AuthContext.js:446 ~ error:',
|
|
811
|
+
console.log('🚀 ~ file: AuthContext.js:446 ~ error:', _context15.t0);
|
|
848
812
|
_this.setState({
|
|
849
|
-
verifyEmailError:
|
|
813
|
+
verifyEmailError: _context15.t0,
|
|
850
814
|
isVerifyingEmail: false,
|
|
851
815
|
isFetchingUser: false
|
|
852
816
|
});
|
|
853
817
|
//throw error
|
|
854
818
|
case 28:
|
|
855
819
|
case "end":
|
|
856
|
-
return
|
|
820
|
+
return _context15.stop();
|
|
857
821
|
}
|
|
858
|
-
},
|
|
822
|
+
}, _callee15, null, [[3, 12]]);
|
|
859
823
|
})));
|
|
860
824
|
_defineProperty(_assertThisInitialized(_this), "handleResetPassword", /*#__PURE__*/function () {
|
|
861
|
-
var
|
|
825
|
+
var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(password) {
|
|
862
826
|
var location, query, oobCode;
|
|
863
|
-
return _regeneratorRuntime().wrap(function
|
|
864
|
-
while (1) switch (
|
|
827
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
828
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
865
829
|
case 0:
|
|
866
830
|
location = _this.props.location;
|
|
867
|
-
|
|
831
|
+
_context16.prev = 1;
|
|
868
832
|
query = new URLSearchParams(location.search);
|
|
869
833
|
oobCode = query.get('oobCode');
|
|
870
|
-
|
|
834
|
+
_context16.next = 6;
|
|
871
835
|
return _Auth.default.handleResetPassword(oobCode, password);
|
|
872
836
|
case 6:
|
|
873
|
-
|
|
837
|
+
_context16.next = 21;
|
|
874
838
|
break;
|
|
875
839
|
case 8:
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
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;
|
|
880
844
|
break;
|
|
881
845
|
case 13:
|
|
882
|
-
|
|
883
|
-
return
|
|
846
|
+
_context16.t0.message = 'This link has expired. Please try reseting password again.';
|
|
847
|
+
return _context16.abrupt("break", 20);
|
|
884
848
|
case 15:
|
|
885
|
-
|
|
886
|
-
return
|
|
849
|
+
_context16.t0.message = 'This link is invalid. Please try reseting password again.';
|
|
850
|
+
return _context16.abrupt("break", 20);
|
|
887
851
|
case 17:
|
|
888
|
-
|
|
889
|
-
return
|
|
852
|
+
_context16.t0.message = 'Your account has been disabled. Please contact our support.';
|
|
853
|
+
return _context16.abrupt("break", 20);
|
|
890
854
|
case 19:
|
|
891
|
-
return
|
|
855
|
+
return _context16.abrupt("break", 20);
|
|
892
856
|
case 20:
|
|
893
|
-
throw
|
|
857
|
+
throw _context16.t0;
|
|
894
858
|
case 21:
|
|
895
859
|
case "end":
|
|
896
|
-
return
|
|
860
|
+
return _context16.stop();
|
|
897
861
|
}
|
|
898
|
-
},
|
|
862
|
+
}, _callee16, null, [[1, 8]]);
|
|
899
863
|
}));
|
|
900
|
-
return function (
|
|
901
|
-
return
|
|
864
|
+
return function (_x18) {
|
|
865
|
+
return _ref16.apply(this, arguments);
|
|
902
866
|
};
|
|
903
867
|
}());
|
|
904
|
-
_defineProperty(_assertThisInitialized(_this), "sendWelcomeEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
905
|
-
return _regeneratorRuntime().wrap(function
|
|
906
|
-
while (1) switch (
|
|
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) {
|
|
907
871
|
case 0:
|
|
908
|
-
|
|
909
|
-
|
|
872
|
+
_context17.prev = 0;
|
|
873
|
+
_context17.next = 3;
|
|
910
874
|
return _Auth.default.sendWelcomeEmail();
|
|
911
875
|
case 3:
|
|
912
|
-
|
|
876
|
+
_context17.next = 8;
|
|
913
877
|
break;
|
|
914
878
|
case 5:
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
console.log("Error sending welcome email: ".concat(
|
|
879
|
+
_context17.prev = 5;
|
|
880
|
+
_context17.t0 = _context17["catch"](0);
|
|
881
|
+
console.log("Error sending welcome email: ".concat(_context17.t0));
|
|
918
882
|
// No need to throw error, let the app continue even if it fails
|
|
919
883
|
case 8:
|
|
920
884
|
case "end":
|
|
921
|
-
return
|
|
885
|
+
return _context17.stop();
|
|
922
886
|
}
|
|
923
|
-
},
|
|
887
|
+
}, _callee17, null, [[0, 5]]);
|
|
924
888
|
})));
|
|
925
889
|
_defineProperty(_assertThisInitialized(_this), "uploaProofOfAddress", /*#__PURE__*/function () {
|
|
926
|
-
var
|
|
890
|
+
var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(data, ip) {
|
|
927
891
|
var user;
|
|
928
|
-
return _regeneratorRuntime().wrap(function
|
|
929
|
-
while (1) switch (
|
|
892
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
893
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
930
894
|
case 0:
|
|
931
|
-
|
|
932
|
-
|
|
895
|
+
_context18.prev = 0;
|
|
896
|
+
_context18.next = 3;
|
|
933
897
|
return _Auth.default.uploaProofOfAddress(data, ip);
|
|
934
898
|
case 3:
|
|
935
|
-
user =
|
|
899
|
+
user = _context18.sent;
|
|
936
900
|
_this.setUser(user);
|
|
937
|
-
|
|
901
|
+
_context18.next = 11;
|
|
938
902
|
break;
|
|
939
903
|
case 7:
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
console.log("Error uploading proof of address: ".concat(
|
|
943
|
-
throw
|
|
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;
|
|
944
908
|
case 11:
|
|
945
909
|
case "end":
|
|
946
|
-
return
|
|
910
|
+
return _context18.stop();
|
|
947
911
|
}
|
|
948
|
-
},
|
|
912
|
+
}, _callee18, null, [[0, 7]]);
|
|
949
913
|
}));
|
|
950
|
-
return function (
|
|
951
|
-
return
|
|
914
|
+
return function (_x19, _x20) {
|
|
915
|
+
return _ref18.apply(this, arguments);
|
|
952
916
|
};
|
|
953
917
|
}());
|
|
954
918
|
_defineProperty(_assertThisInitialized(_this), "validateGreenWalletId", /*#__PURE__*/function () {
|
|
955
|
-
var
|
|
956
|
-
return _regeneratorRuntime().wrap(function
|
|
957
|
-
while (1) switch (
|
|
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) {
|
|
958
922
|
case 0:
|
|
959
|
-
|
|
960
|
-
|
|
923
|
+
_context19.prev = 0;
|
|
924
|
+
_context19.next = 3;
|
|
961
925
|
return _Auth.default.validateGreenWalletId(id);
|
|
962
926
|
case 3:
|
|
963
|
-
return
|
|
927
|
+
return _context19.abrupt("return", _context19.sent);
|
|
964
928
|
case 6:
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
console.log("Error validating Green Wallet ID: ".concat(
|
|
968
|
-
throw
|
|
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;
|
|
969
933
|
case 10:
|
|
970
934
|
case "end":
|
|
971
|
-
return
|
|
935
|
+
return _context19.stop();
|
|
972
936
|
}
|
|
973
|
-
},
|
|
937
|
+
}, _callee19, null, [[0, 6]]);
|
|
974
938
|
}));
|
|
975
|
-
return function (
|
|
976
|
-
return
|
|
939
|
+
return function (_x21) {
|
|
940
|
+
return _ref19.apply(this, arguments);
|
|
977
941
|
};
|
|
978
942
|
}());
|
|
979
943
|
_defineProperty(_assertThisInitialized(_this), "createWallet", /*#__PURE__*/function () {
|
|
980
|
-
var
|
|
944
|
+
var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(data) {
|
|
981
945
|
var wallet;
|
|
982
|
-
return _regeneratorRuntime().wrap(function
|
|
983
|
-
while (1) switch (
|
|
946
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
947
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
984
948
|
case 0:
|
|
985
|
-
|
|
986
|
-
|
|
949
|
+
_context20.prev = 0;
|
|
950
|
+
_context20.next = 3;
|
|
987
951
|
return _Auth.default.createWallet(data);
|
|
988
952
|
case 3:
|
|
989
|
-
wallet =
|
|
990
|
-
return
|
|
953
|
+
wallet = _context20.sent;
|
|
954
|
+
return _context20.abrupt("return", wallet);
|
|
991
955
|
case 7:
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
console.log("Error creating wallet: ".concat(
|
|
995
|
-
throw
|
|
956
|
+
_context20.prev = 7;
|
|
957
|
+
_context20.t0 = _context20["catch"](0);
|
|
958
|
+
console.log("Error creating wallet: ".concat(_context20.t0));
|
|
959
|
+
throw _context20.t0;
|
|
996
960
|
case 11:
|
|
997
961
|
case "end":
|
|
998
|
-
return
|
|
962
|
+
return _context20.stop();
|
|
999
963
|
}
|
|
1000
|
-
},
|
|
964
|
+
}, _callee20, null, [[0, 7]]);
|
|
1001
965
|
}));
|
|
1002
|
-
return function (
|
|
1003
|
-
return
|
|
966
|
+
return function (_x22) {
|
|
967
|
+
return _ref20.apply(this, arguments);
|
|
1004
968
|
};
|
|
1005
969
|
}());
|
|
1006
970
|
_defineProperty(_assertThisInitialized(_this), "setUser", function (user) {
|
|
@@ -1012,12 +976,12 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
1012
976
|
});
|
|
1013
977
|
});
|
|
1014
978
|
_defineProperty(_assertThisInitialized(_this), "fetchLastTime", /*#__PURE__*/function () {
|
|
1015
|
-
var
|
|
979
|
+
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(projectName, page, userId) {
|
|
1016
980
|
var filterBody, response;
|
|
1017
|
-
return _regeneratorRuntime().wrap(function
|
|
1018
|
-
while (1) switch (
|
|
981
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
982
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1019
983
|
case 0:
|
|
1020
|
-
|
|
984
|
+
_context21.prev = 0;
|
|
1021
985
|
filterBody = {
|
|
1022
986
|
projectName: projectName,
|
|
1023
987
|
page: page
|
|
@@ -1025,25 +989,25 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
1025
989
|
if (userId) {
|
|
1026
990
|
filterBody.userId = userId;
|
|
1027
991
|
}
|
|
1028
|
-
|
|
992
|
+
_context21.next = 5;
|
|
1029
993
|
return _Auth.default.fetchTrackingUserLastTime({
|
|
1030
994
|
filter: filterBody
|
|
1031
995
|
});
|
|
1032
996
|
case 5:
|
|
1033
|
-
response =
|
|
1034
|
-
return
|
|
997
|
+
response = _context21.sent;
|
|
998
|
+
return _context21.abrupt("return", response);
|
|
1035
999
|
case 9:
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
console.log(' error',
|
|
1000
|
+
_context21.prev = 9;
|
|
1001
|
+
_context21.t0 = _context21["catch"](0);
|
|
1002
|
+
console.log(' error', _context21.t0);
|
|
1039
1003
|
case 12:
|
|
1040
1004
|
case "end":
|
|
1041
|
-
return
|
|
1005
|
+
return _context21.stop();
|
|
1042
1006
|
}
|
|
1043
|
-
},
|
|
1007
|
+
}, _callee21, null, [[0, 9]]);
|
|
1044
1008
|
}));
|
|
1045
|
-
return function (_x24, _x25
|
|
1046
|
-
return
|
|
1009
|
+
return function (_x23, _x24, _x25) {
|
|
1010
|
+
return _ref21.apply(this, arguments);
|
|
1047
1011
|
};
|
|
1048
1012
|
}());
|
|
1049
1013
|
return _this;
|
|
@@ -1095,7 +1059,6 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
1095
1059
|
updateFirebaseUser: _Auth.default.updateFirebaseUser,
|
|
1096
1060
|
handleResetPassword: this.handleResetPassword,
|
|
1097
1061
|
handleVerifyEmail: this.handleVerifyEmail,
|
|
1098
|
-
checkActivationLinkExpired: this.checkActivationLinkExpired,
|
|
1099
1062
|
setUser: this.setUser,
|
|
1100
1063
|
refreshIdToken: _Auth.default.refreshIdToken
|
|
1101
1064
|
})
|