@stokr/components-library 2.0.0-beta.6 → 2.0.0-beta.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.
|
@@ -133,7 +133,6 @@ var RegisterModal = function RegisterModal(props) {
|
|
|
133
133
|
}();
|
|
134
134
|
var validationSchema = Yup.object().shape({
|
|
135
135
|
email: Yup.string().email("Oops, that's not a valid address").required('Oops, this can‘t be blank'),
|
|
136
|
-
username: Yup.string(),
|
|
137
136
|
password: Yup.string().required('Oops, this can‘t be blank'),
|
|
138
137
|
terms: Yup.bool().oneOf([true], 'Please agree to continue'),
|
|
139
138
|
newsletter: Yup.bool() // .oneOf([true], 'Newsletter accept is required'),
|
|
@@ -168,7 +167,6 @@ var RegisterModal = function RegisterModal(props) {
|
|
|
168
167
|
}, /*#__PURE__*/_react.default.createElement(_Modal.ModalInner, null, /*#__PURE__*/_react.default.createElement(_formik.Formik, {
|
|
169
168
|
initialValues: {
|
|
170
169
|
email: '',
|
|
171
|
-
username: '',
|
|
172
170
|
password: '',
|
|
173
171
|
newsletter: false,
|
|
174
172
|
terms: false
|
|
@@ -186,7 +184,7 @@ var RegisterModal = function RegisterModal(props) {
|
|
|
186
184
|
setFieldValue = _ref2.setFieldValue,
|
|
187
185
|
setFieldTouched = _ref2.setFieldTouched;
|
|
188
186
|
if (popupError.popup === 'register' && !popupErrorWithValue.value) {
|
|
189
|
-
var value = popupError.field === '
|
|
187
|
+
var value = popupError.field === 'email' ? values.email : values.password;
|
|
190
188
|
setpopupErrorWithValue(_objectSpread(_objectSpread({}, popupErrorWithValue), {}, {
|
|
191
189
|
value: value
|
|
192
190
|
}));
|
|
@@ -234,25 +232,6 @@ var RegisterModal = function RegisterModal(props) {
|
|
|
234
232
|
}, errors.email))), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
|
|
235
233
|
noPaddingBottom: true,
|
|
236
234
|
noPaddingHorizontal: true
|
|
237
|
-
// paddingTop="47"
|
|
238
|
-
}, /*#__PURE__*/_react.default.createElement(_formikPersist.Persist, {
|
|
239
|
-
name: "signup-username",
|
|
240
|
-
isSessionStorage: true
|
|
241
|
-
}), /*#__PURE__*/_react.default.createElement(_Form.FormField, null, /*#__PURE__*/_react.default.createElement(_InputUsername.default, {
|
|
242
|
-
id: "sign-up-username",
|
|
243
|
-
name: "username",
|
|
244
|
-
type: "text",
|
|
245
|
-
label: "Your username",
|
|
246
|
-
value: values.username,
|
|
247
|
-
onChange: handleChangeCustom,
|
|
248
|
-
onBlur: handleBlur,
|
|
249
|
-
error: !!errors.username,
|
|
250
|
-
touched: !!touched.username
|
|
251
|
-
}), /*#__PURE__*/_react.default.createElement(_Form.FormError, {
|
|
252
|
-
show: errors.username && touched.username
|
|
253
|
-
}, errors.username))), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
|
|
254
|
-
noPaddingBottom: true,
|
|
255
|
-
noPaddingHorizontal: true
|
|
256
235
|
}, /*#__PURE__*/_react.default.createElement(_Form.FormField, null, /*#__PURE__*/_react.default.createElement(_InputPassword.default, {
|
|
257
236
|
id: "sign-up-password",
|
|
258
237
|
name: "password",
|
|
@@ -102,6 +102,14 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
102
102
|
signUp = isModalOpen.signUp,
|
|
103
103
|
resetPassword = isModalOpen.resetPassword;
|
|
104
104
|
|
|
105
|
+
//checks if any modal is open
|
|
106
|
+
//if true we won't open any modal from below
|
|
107
|
+
var isAnyModalOpen = Object.values(isModalOpen).some(function (value) {
|
|
108
|
+
return value === true;
|
|
109
|
+
});
|
|
110
|
+
if (isAnyModalOpen) return;
|
|
111
|
+
console.log('🚀 ~ file: HeaderHo.jsx:102 ~ this.props:', _this.props);
|
|
112
|
+
|
|
105
113
|
//dont open if modal is already open or user is logged in
|
|
106
114
|
if (isLogin && !user && !login) {
|
|
107
115
|
_this.setState(function (prevState) {
|
|
@@ -155,6 +163,12 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
155
163
|
});
|
|
156
164
|
_defineProperty(_assertThisInitialized(_this), "switchOpenModal", function (prevModalId, nextModalId) {
|
|
157
165
|
var isModalOpen = _this.state.isModalOpen;
|
|
166
|
+
|
|
167
|
+
//if you previously were on /signup or any other route and you want to swtich to login modal
|
|
168
|
+
//we need to change the url accordingly so if you refresh the page, the modal will open
|
|
169
|
+
if (nextModalId === 'login' || nextModalId === 'signUp') {
|
|
170
|
+
window.history.pushState('', '', nextModalId === 'login' ? '/login' : nextModalId === 'signUp' ? '/signup' : '/');
|
|
171
|
+
}
|
|
158
172
|
_this.setState(function (prevState) {
|
|
159
173
|
var _objectSpread3;
|
|
160
174
|
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
@@ -480,70 +494,43 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
480
494
|
},
|
|
481
495
|
onFormSend: /*#__PURE__*/function () {
|
|
482
496
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(userInfo) {
|
|
483
|
-
var referralCode, checkedCheckboxes;
|
|
484
497
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
485
498
|
while (1) switch (_context3.prev = _context3.next) {
|
|
486
499
|
case 0:
|
|
487
500
|
_this2.clearPopupError();
|
|
488
501
|
_this2.setIsActionLoading('signUp');
|
|
489
|
-
|
|
490
|
-
// try {
|
|
491
|
-
// const result = await fetchDataPublic('user/checkUsernameExists', {
|
|
492
|
-
// username: userInfo.username,
|
|
493
|
-
// })
|
|
494
|
-
// if (result.usernameExists) {
|
|
495
|
-
// this.setPopupError(
|
|
496
|
-
// 'register',
|
|
497
|
-
// 'This username is already taken',
|
|
498
|
-
// 'username',
|
|
499
|
-
// )
|
|
500
|
-
// this.setIsActionLoading(undefined)
|
|
501
|
-
// return
|
|
502
|
-
// }
|
|
503
|
-
// } catch (error) {
|
|
504
|
-
// console.log(error)
|
|
505
|
-
// this.setPopupError('register', 'Oops, something went wrong')
|
|
506
|
-
// this.setIsActionLoading(undefined)
|
|
507
|
-
// return
|
|
508
|
-
// }
|
|
502
|
+
|
|
509
503
|
//check password
|
|
510
|
-
_context3.prev =
|
|
504
|
+
_context3.prev = 2;
|
|
511
505
|
if (!(userInfo.password.length > 128)) {
|
|
512
|
-
_context3.next =
|
|
506
|
+
_context3.next = 7;
|
|
513
507
|
break;
|
|
514
508
|
}
|
|
515
509
|
_this2.setPopupError('register', 'Your password cannot exceed 128 characters', 'password');
|
|
516
510
|
_this2.setIsActionLoading(undefined);
|
|
517
511
|
return _context3.abrupt("return");
|
|
518
|
-
case
|
|
519
|
-
|
|
520
|
-
//so we want to make sure that the EP receives checkedCheckboxes
|
|
521
|
-
checkedCheckboxes = [];
|
|
522
|
-
if (userInfo.newsletter) checkedCheckboxes.push('newsletter');
|
|
523
|
-
if (userInfo.terms) checkedCheckboxes.push('privacyTerms');
|
|
524
|
-
|
|
525
|
-
// await authAPI('signup', {
|
|
526
|
-
// email: userInfo.email,
|
|
527
|
-
// password: userInfo.password,
|
|
528
|
-
// userType: 'investor',
|
|
529
|
-
// // fa2: false,
|
|
530
|
-
// newsletter: userInfo.newsletter,
|
|
531
|
-
// terms: userInfo.terms,
|
|
532
|
-
// username: userInfo.username,
|
|
533
|
-
// tapfiliateReferralCode: referralCode,
|
|
534
|
-
// checkedCheckboxes,
|
|
535
|
-
// })
|
|
536
|
-
_context3.next = 13;
|
|
512
|
+
case 7:
|
|
513
|
+
_context3.next = 9;
|
|
537
514
|
return createUser(userInfo.email, userInfo.password);
|
|
538
|
-
case
|
|
515
|
+
case 9:
|
|
516
|
+
if (!userInfo.newsletter) {
|
|
517
|
+
_context3.next = 12;
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
_context3.next = 12;
|
|
521
|
+
return (0, _fetchDataPublic.default)('emails/subscribe', {
|
|
522
|
+
email: userInfo.email,
|
|
523
|
+
listName: 'newsletter'
|
|
524
|
+
});
|
|
525
|
+
case 12:
|
|
539
526
|
_this2.setUserInfo(userInfo);
|
|
540
527
|
_this2.switchOpenModal('signUp', 'confirm');
|
|
541
528
|
_this2.setIsActionLoading(undefined);
|
|
542
|
-
_context3.next =
|
|
529
|
+
_context3.next = 22;
|
|
543
530
|
break;
|
|
544
|
-
case
|
|
545
|
-
_context3.prev =
|
|
546
|
-
_context3.t0 = _context3["catch"](
|
|
531
|
+
case 17:
|
|
532
|
+
_context3.prev = 17;
|
|
533
|
+
_context3.t0 = _context3["catch"](2);
|
|
547
534
|
console.log(_context3.t0);
|
|
548
535
|
_this2.setIsActionLoading(undefined);
|
|
549
536
|
if ((_context3.t0 === null || _context3.t0 === void 0 ? void 0 : _context3.t0.code) === 'auth/email-already-in-use') {
|
|
@@ -553,11 +540,11 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
553
540
|
} else {
|
|
554
541
|
_this2.setPopupError('register', 'Oops, something went wrong');
|
|
555
542
|
}
|
|
556
|
-
case
|
|
543
|
+
case 22:
|
|
557
544
|
case "end":
|
|
558
545
|
return _context3.stop();
|
|
559
546
|
}
|
|
560
|
-
}, _callee3, null, [[
|
|
547
|
+
}, _callee3, null, [[2, 17]]);
|
|
561
548
|
}));
|
|
562
549
|
return function (_x3) {
|
|
563
550
|
return _ref6.apply(this, arguments);
|
|
@@ -678,6 +665,7 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
678
665
|
_this2.setIsActionLoading(undefined);
|
|
679
666
|
},
|
|
680
667
|
onModalSwitch: function onModalSwitch() {
|
|
668
|
+
window.history.pushState({}, null, '/login');
|
|
681
669
|
_this2.switchOpenModal('resetPassword', 'login');
|
|
682
670
|
_this2.clearPopupError();
|
|
683
671
|
_this2.setIsActionLoading(undefined);
|
|
@@ -692,8 +680,8 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
692
680
|
_this2.clearPopupError();
|
|
693
681
|
_this2.setIsActionLoading('resetPassword');
|
|
694
682
|
|
|
695
|
-
//https://stokr.info/manage-user?mode=resetPassword&oobCode=PT_AyRFYWXwDe0Ols12TOKSiGQUSdb6mM4DKDLwHGdQAAAGMgUUaEQ&apiKey=AIzaSyBBp_3Romnfv--YpUuV0mJgDymvSp3oq0c&continueUrl=https%3A%2F%2Fstokr.info&lang=en
|
|
696
683
|
//localhost:3001/manage-user?mode=resetPassword&oobCode=PT_AyRFYWXwDe0Ols12TOKSiGQUSdb6mM4DKDLwHGdQAAAGMgUUaEQ&apiKey=AIzaSyBBp_3Romnfv--YpUuV0mJgDymvSp3oq0c&continueUrl=https%3A%2F%2Fstokr.info&lang=en
|
|
684
|
+
//https://stokr.info/manage-user?mode=resetPassword&oobCode=TGhCFwb9uLeYiL2Hp4LFgRg5Fd9osw1Fvza4qY5Hhy0AAAGMgmuGuw&apiKey=AIzaSyBBp_3Romnfv--YpUuV0mJgDymvSp3oq0c&continueUrl=https%3A%2F%2Fstokr.info&lang=en
|
|
697
685
|
_context6.prev = 3;
|
|
698
686
|
_context6.next = 6;
|
|
699
687
|
return handleResetPassword(password);
|
package/dist/context/Auth.js
CHANGED
|
@@ -100,6 +100,19 @@ var Auth = /*#__PURE__*/function () {
|
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
|
+
}, {
|
|
104
|
+
key: "handleVerifyEmail",
|
|
105
|
+
value: function handleVerifyEmail(actionCode, continueUrl) {
|
|
106
|
+
return new Promise(function (resolve, reject) {
|
|
107
|
+
// Try to apply the email verification code.
|
|
108
|
+
(0, _auth.applyActionCode)(_firebaseConfig.auth, actionCode).then(function (resp) {
|
|
109
|
+
// Email address has been verified.
|
|
110
|
+
resolve(resp);
|
|
111
|
+
}).catch(function (error) {
|
|
112
|
+
reject(error);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
}
|
|
103
116
|
}, {
|
|
104
117
|
key: "handleResetPassword",
|
|
105
118
|
value: function handleResetPassword(actionCode, newPassword, continueUrl) {
|
|
@@ -110,7 +123,8 @@ var Auth = /*#__PURE__*/function () {
|
|
|
110
123
|
(0, _auth.confirmPasswordReset)(_firebaseConfig.auth, actionCode, newPassword).then(function (resp) {
|
|
111
124
|
// Password reset has been confirmed and new password updated.
|
|
112
125
|
|
|
113
|
-
|
|
126
|
+
//signInWithEmailAndPassword(accountEmail, newPassword)
|
|
127
|
+
|
|
114
128
|
resolve(accountEmail);
|
|
115
129
|
}).catch(function (error) {
|
|
116
130
|
// Error occurred during confirmation. The code might have expired or the
|
|
@@ -692,150 +692,189 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
692
692
|
return _ref13.apply(this, arguments);
|
|
693
693
|
};
|
|
694
694
|
}());
|
|
695
|
+
_defineProperty(_assertThisInitialized(_this), "handleVerifyEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
696
|
+
var location, query, oobCode;
|
|
697
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
698
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
699
|
+
case 0:
|
|
700
|
+
location = _this.props.location;
|
|
701
|
+
_context14.prev = 1;
|
|
702
|
+
query = new URLSearchParams(location.search);
|
|
703
|
+
oobCode = query.get('oobCode');
|
|
704
|
+
_context14.next = 6;
|
|
705
|
+
return _Auth.default.handleVerifyEmail(oobCode);
|
|
706
|
+
case 6:
|
|
707
|
+
_context14.next = 21;
|
|
708
|
+
break;
|
|
709
|
+
case 8:
|
|
710
|
+
_context14.prev = 8;
|
|
711
|
+
_context14.t0 = _context14["catch"](1);
|
|
712
|
+
_context14.t1 = _context14.t0 === null || _context14.t0 === void 0 ? void 0 : _context14.t0.code;
|
|
713
|
+
_context14.next = _context14.t1 === 'auth/expired-action-code' ? 13 : _context14.t1 === 'auth/invalid-action-code' ? 15 : _context14.t1 === 'auth/user-disabled' ? 17 : 19;
|
|
714
|
+
break;
|
|
715
|
+
case 13:
|
|
716
|
+
_context14.t0.message = 'This link has expired. Please try reseting password again.';
|
|
717
|
+
return _context14.abrupt("break", 20);
|
|
718
|
+
case 15:
|
|
719
|
+
_context14.t0.message = 'This link is invalid. Please try reseting password again.';
|
|
720
|
+
return _context14.abrupt("break", 20);
|
|
721
|
+
case 17:
|
|
722
|
+
_context14.t0.message = 'Your account has been disabled. Please contact our support.';
|
|
723
|
+
return _context14.abrupt("break", 20);
|
|
724
|
+
case 19:
|
|
725
|
+
return _context14.abrupt("break", 20);
|
|
726
|
+
case 20:
|
|
727
|
+
throw _context14.t0;
|
|
728
|
+
case 21:
|
|
729
|
+
case "end":
|
|
730
|
+
return _context14.stop();
|
|
731
|
+
}
|
|
732
|
+
}, _callee14, null, [[1, 8]]);
|
|
733
|
+
})));
|
|
695
734
|
_defineProperty(_assertThisInitialized(_this), "handleResetPassword", /*#__PURE__*/function () {
|
|
696
|
-
var
|
|
735
|
+
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(password) {
|
|
697
736
|
var location, query, oobCode;
|
|
698
|
-
return _regeneratorRuntime().wrap(function
|
|
699
|
-
while (1) switch (
|
|
737
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
738
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
700
739
|
case 0:
|
|
701
740
|
location = _this.props.location;
|
|
702
|
-
|
|
741
|
+
_context15.prev = 1;
|
|
703
742
|
query = new URLSearchParams(location.search);
|
|
704
743
|
oobCode = query.get('oobCode');
|
|
705
|
-
|
|
744
|
+
_context15.next = 6;
|
|
706
745
|
return _Auth.default.handleResetPassword(oobCode, password);
|
|
707
746
|
case 6:
|
|
708
|
-
|
|
747
|
+
_context15.next = 21;
|
|
709
748
|
break;
|
|
710
749
|
case 8:
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
750
|
+
_context15.prev = 8;
|
|
751
|
+
_context15.t0 = _context15["catch"](1);
|
|
752
|
+
_context15.t1 = _context15.t0 === null || _context15.t0 === void 0 ? void 0 : _context15.t0.code;
|
|
753
|
+
_context15.next = _context15.t1 === 'auth/expired-action-code' ? 13 : _context15.t1 === 'auth/invalid-action-code' ? 15 : _context15.t1 === 'auth/user-disabled' ? 17 : 19;
|
|
715
754
|
break;
|
|
716
755
|
case 13:
|
|
717
|
-
|
|
718
|
-
return
|
|
756
|
+
_context15.t0.message = 'This link has expired. Please try reseting password again.';
|
|
757
|
+
return _context15.abrupt("break", 20);
|
|
719
758
|
case 15:
|
|
720
|
-
|
|
721
|
-
return
|
|
759
|
+
_context15.t0.message = 'This link is invalid. Please try reseting password again.';
|
|
760
|
+
return _context15.abrupt("break", 20);
|
|
722
761
|
case 17:
|
|
723
|
-
|
|
724
|
-
return
|
|
762
|
+
_context15.t0.message = 'Your account has been disabled. Please contact our support.';
|
|
763
|
+
return _context15.abrupt("break", 20);
|
|
725
764
|
case 19:
|
|
726
|
-
return
|
|
765
|
+
return _context15.abrupt("break", 20);
|
|
727
766
|
case 20:
|
|
728
|
-
throw
|
|
767
|
+
throw _context15.t0;
|
|
729
768
|
case 21:
|
|
730
769
|
case "end":
|
|
731
|
-
return
|
|
770
|
+
return _context15.stop();
|
|
732
771
|
}
|
|
733
|
-
},
|
|
772
|
+
}, _callee15, null, [[1, 8]]);
|
|
734
773
|
}));
|
|
735
774
|
return function (_x16) {
|
|
736
|
-
return
|
|
775
|
+
return _ref15.apply(this, arguments);
|
|
737
776
|
};
|
|
738
777
|
}());
|
|
739
|
-
_defineProperty(_assertThisInitialized(_this), "sendWelcomeEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
740
|
-
return _regeneratorRuntime().wrap(function
|
|
741
|
-
while (1) switch (
|
|
778
|
+
_defineProperty(_assertThisInitialized(_this), "sendWelcomeEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
779
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
780
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
742
781
|
case 0:
|
|
743
|
-
|
|
744
|
-
|
|
782
|
+
_context16.prev = 0;
|
|
783
|
+
_context16.next = 3;
|
|
745
784
|
return _Auth.default.sendWelcomeEmail();
|
|
746
785
|
case 3:
|
|
747
|
-
|
|
786
|
+
_context16.next = 8;
|
|
748
787
|
break;
|
|
749
788
|
case 5:
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
console.log("Error sending welcome email: ".concat(
|
|
789
|
+
_context16.prev = 5;
|
|
790
|
+
_context16.t0 = _context16["catch"](0);
|
|
791
|
+
console.log("Error sending welcome email: ".concat(_context16.t0));
|
|
753
792
|
// No need to throw error, let the app continue even if it fails
|
|
754
793
|
case 8:
|
|
755
794
|
case "end":
|
|
756
|
-
return
|
|
795
|
+
return _context16.stop();
|
|
757
796
|
}
|
|
758
|
-
},
|
|
797
|
+
}, _callee16, null, [[0, 5]]);
|
|
759
798
|
})));
|
|
760
799
|
_defineProperty(_assertThisInitialized(_this), "uploaProofOfAddress", /*#__PURE__*/function () {
|
|
761
|
-
var
|
|
800
|
+
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(data, ip) {
|
|
762
801
|
var user;
|
|
763
|
-
return _regeneratorRuntime().wrap(function
|
|
764
|
-
while (1) switch (
|
|
802
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
803
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
765
804
|
case 0:
|
|
766
|
-
|
|
767
|
-
|
|
805
|
+
_context17.prev = 0;
|
|
806
|
+
_context17.next = 3;
|
|
768
807
|
return _Auth.default.uploaProofOfAddress(data, ip);
|
|
769
808
|
case 3:
|
|
770
|
-
user =
|
|
809
|
+
user = _context17.sent;
|
|
771
810
|
_this.setUser(user);
|
|
772
|
-
|
|
811
|
+
_context17.next = 11;
|
|
773
812
|
break;
|
|
774
813
|
case 7:
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
console.log("Error uploading proof of address: ".concat(
|
|
778
|
-
throw
|
|
814
|
+
_context17.prev = 7;
|
|
815
|
+
_context17.t0 = _context17["catch"](0);
|
|
816
|
+
console.log("Error uploading proof of address: ".concat(_context17.t0));
|
|
817
|
+
throw _context17.t0;
|
|
779
818
|
case 11:
|
|
780
819
|
case "end":
|
|
781
|
-
return
|
|
820
|
+
return _context17.stop();
|
|
782
821
|
}
|
|
783
|
-
},
|
|
822
|
+
}, _callee17, null, [[0, 7]]);
|
|
784
823
|
}));
|
|
785
824
|
return function (_x17, _x18) {
|
|
786
|
-
return
|
|
825
|
+
return _ref17.apply(this, arguments);
|
|
787
826
|
};
|
|
788
827
|
}());
|
|
789
828
|
_defineProperty(_assertThisInitialized(_this), "validateGreenWalletId", /*#__PURE__*/function () {
|
|
790
|
-
var
|
|
791
|
-
return _regeneratorRuntime().wrap(function
|
|
792
|
-
while (1) switch (
|
|
829
|
+
var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(id) {
|
|
830
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
831
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
793
832
|
case 0:
|
|
794
|
-
|
|
795
|
-
|
|
833
|
+
_context18.prev = 0;
|
|
834
|
+
_context18.next = 3;
|
|
796
835
|
return _Auth.default.validateGreenWalletId(id);
|
|
797
836
|
case 3:
|
|
798
|
-
return
|
|
837
|
+
return _context18.abrupt("return", _context18.sent);
|
|
799
838
|
case 6:
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
console.log("Error validating Green Wallet ID: ".concat(
|
|
803
|
-
throw
|
|
839
|
+
_context18.prev = 6;
|
|
840
|
+
_context18.t0 = _context18["catch"](0);
|
|
841
|
+
console.log("Error validating Green Wallet ID: ".concat(_context18.t0));
|
|
842
|
+
throw _context18.t0;
|
|
804
843
|
case 10:
|
|
805
844
|
case "end":
|
|
806
|
-
return
|
|
845
|
+
return _context18.stop();
|
|
807
846
|
}
|
|
808
|
-
},
|
|
847
|
+
}, _callee18, null, [[0, 6]]);
|
|
809
848
|
}));
|
|
810
849
|
return function (_x19) {
|
|
811
|
-
return
|
|
850
|
+
return _ref18.apply(this, arguments);
|
|
812
851
|
};
|
|
813
852
|
}());
|
|
814
853
|
_defineProperty(_assertThisInitialized(_this), "createWallet", /*#__PURE__*/function () {
|
|
815
|
-
var
|
|
854
|
+
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(data) {
|
|
816
855
|
var wallet;
|
|
817
|
-
return _regeneratorRuntime().wrap(function
|
|
818
|
-
while (1) switch (
|
|
856
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
857
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
819
858
|
case 0:
|
|
820
|
-
|
|
821
|
-
|
|
859
|
+
_context19.prev = 0;
|
|
860
|
+
_context19.next = 3;
|
|
822
861
|
return _Auth.default.createWallet(data);
|
|
823
862
|
case 3:
|
|
824
|
-
wallet =
|
|
825
|
-
return
|
|
863
|
+
wallet = _context19.sent;
|
|
864
|
+
return _context19.abrupt("return", wallet);
|
|
826
865
|
case 7:
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
console.log("Error creating wallet: ".concat(
|
|
830
|
-
throw
|
|
866
|
+
_context19.prev = 7;
|
|
867
|
+
_context19.t0 = _context19["catch"](0);
|
|
868
|
+
console.log("Error creating wallet: ".concat(_context19.t0));
|
|
869
|
+
throw _context19.t0;
|
|
831
870
|
case 11:
|
|
832
871
|
case "end":
|
|
833
|
-
return
|
|
872
|
+
return _context19.stop();
|
|
834
873
|
}
|
|
835
|
-
},
|
|
874
|
+
}, _callee19, null, [[0, 7]]);
|
|
836
875
|
}));
|
|
837
876
|
return function (_x20) {
|
|
838
|
-
return
|
|
877
|
+
return _ref19.apply(this, arguments);
|
|
839
878
|
};
|
|
840
879
|
}());
|
|
841
880
|
_defineProperty(_assertThisInitialized(_this), "setUser", function (user) {
|
|
@@ -847,12 +886,12 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
847
886
|
});
|
|
848
887
|
});
|
|
849
888
|
_defineProperty(_assertThisInitialized(_this), "fetchLastTime", /*#__PURE__*/function () {
|
|
850
|
-
var
|
|
889
|
+
var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(projectName, page, userId) {
|
|
851
890
|
var filterBody, response;
|
|
852
|
-
return _regeneratorRuntime().wrap(function
|
|
853
|
-
while (1) switch (
|
|
891
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
892
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
854
893
|
case 0:
|
|
855
|
-
|
|
894
|
+
_context20.prev = 0;
|
|
856
895
|
filterBody = {
|
|
857
896
|
projectName: projectName,
|
|
858
897
|
page: page
|
|
@@ -860,25 +899,25 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
860
899
|
if (userId) {
|
|
861
900
|
filterBody.userId = userId;
|
|
862
901
|
}
|
|
863
|
-
|
|
902
|
+
_context20.next = 5;
|
|
864
903
|
return _Auth.default.fetchTrackingUserLastTime({
|
|
865
904
|
filter: filterBody
|
|
866
905
|
});
|
|
867
906
|
case 5:
|
|
868
|
-
response =
|
|
869
|
-
return
|
|
907
|
+
response = _context20.sent;
|
|
908
|
+
return _context20.abrupt("return", response);
|
|
870
909
|
case 9:
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
console.log(' error',
|
|
910
|
+
_context20.prev = 9;
|
|
911
|
+
_context20.t0 = _context20["catch"](0);
|
|
912
|
+
console.log(' error', _context20.t0);
|
|
874
913
|
case 12:
|
|
875
914
|
case "end":
|
|
876
|
-
return
|
|
915
|
+
return _context20.stop();
|
|
877
916
|
}
|
|
878
|
-
},
|
|
917
|
+
}, _callee20, null, [[0, 9]]);
|
|
879
918
|
}));
|
|
880
919
|
return function (_x21, _x22, _x23) {
|
|
881
|
-
return
|
|
920
|
+
return _ref20.apply(this, arguments);
|
|
882
921
|
};
|
|
883
922
|
}());
|
|
884
923
|
return _this;
|
|
@@ -886,9 +925,9 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
886
925
|
_createClass(AuthProviderClass, [{
|
|
887
926
|
key: "componentDidMount",
|
|
888
927
|
value: function componentDidMount() {
|
|
889
|
-
var isActivatingUser = window.location.href.includes('
|
|
928
|
+
var isActivatingUser = window.location.href.includes('verifyEmail');
|
|
890
929
|
if (isActivatingUser) {
|
|
891
|
-
this.
|
|
930
|
+
this.handleVerifyEmail();
|
|
892
931
|
} else {
|
|
893
932
|
this.getUser();
|
|
894
933
|
}
|
|
@@ -927,6 +966,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
|
|
|
927
966
|
createUser: _Auth.default.createUser,
|
|
928
967
|
updateFirebaseUser: _Auth.default.updateFirebaseUser,
|
|
929
968
|
handleResetPassword: this.handleResetPassword,
|
|
969
|
+
handleVerifyEmail: this.handleVerifyEmail,
|
|
930
970
|
setUser: this.setUser
|
|
931
971
|
})
|
|
932
972
|
}, children);
|