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