@stokr/components-library 2.0.0-beta.25 → 2.0.0-beta.26

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.
@@ -42,21 +42,22 @@ var fetchData = /*#__PURE__*/function () {
42
42
  });
43
43
  case 8:
44
44
  result = _context.sent;
45
+ console.log('🚀 ~ result:', result);
45
46
  // console.log(result);
46
47
 
47
48
  resolve(result.data);
48
- _context.next = 16;
49
+ _context.next = 17;
49
50
  break;
50
- case 12:
51
- _context.prev = 12;
51
+ case 13:
52
+ _context.prev = 13;
52
53
  _context.t0 = _context["catch"](5);
53
54
  console.log("Error: ".concat(_context.t0));
54
55
  reject(_context.t0);
55
- case 16:
56
+ case 17:
56
57
  case "end":
57
58
  return _context.stop();
58
59
  }
59
- }, _callee, null, [[5, 12]]);
60
+ }, _callee, null, [[5, 13]]);
60
61
  }));
61
62
  return function (_x3, _x4) {
62
63
  return _ref2.apply(this, arguments);
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Wrapper = exports.Row = exports.PageWrapper = exports.Column = void 0;
6
+ exports.Wrapper = exports.Row = exports.PageWrapper = exports.FlexContainer = exports.Column = void 0;
7
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
8
8
  var _grid = _interopRequireDefault(require("../../styles/grid"));
9
9
  var _rwd = _interopRequireDefault(require("../../styles/rwd"));
@@ -65,4 +65,11 @@ var PageWrapper = _styledComponents.default.div.withConfig({
65
65
  displayName: "Gridstyles__PageWrapper",
66
66
  componentId: "sc-1jreazl-3"
67
67
  })(["min-height:100vh;display:flex;flex-direction:column;", "{flex-grow:1;}"], Row);
68
- exports.PageWrapper = PageWrapper;
68
+ exports.PageWrapper = PageWrapper;
69
+ var FlexContainer = _styledComponents.default.div.withConfig({
70
+ displayName: "Gridstyles__FlexContainer",
71
+ componentId: "sc-1jreazl-4"
72
+ })(["display:flex;", ""], function (props) {
73
+ return props.itemsCenter && "align-items:center;";
74
+ });
75
+ exports.FlexContainer = FlexContainer;
@@ -280,7 +280,13 @@ var Header = function Header(_ref3) {
280
280
  isUserLogged: (user === null || user === void 0 ? void 0 : user._id) || (user === null || user === void 0 ? void 0 : user.uid)
281
281
  }, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, user !== null && user !== void 0 && user._id || user !== null && user !== void 0 && user.uid ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, signupFlow ? /*#__PURE__*/_react.default.createElement(_Button.default, {
282
282
  onClick: logoutUser
283
- }, "Log Out") : /*#__PURE__*/_react.default.createElement(_Header.UserAccount, null, /*#__PURE__*/_react.default.createElement(_Header.UserButton, {
283
+ }, "Log Out") : /*#__PURE__*/_react.default.createElement(_Grid.FlexContainer, {
284
+ itemsCenter: true
285
+ }, /*#__PURE__*/_react.default.createElement(_breakdown.default, null, /*#__PURE__*/_react.default.createElement(_Header.LoginButton, {
286
+ onClick: function onClick() {
287
+ isAdmin ? window.location.href = 'https://admin.' + _globalVariables.platformDomain : window.location.href = "".concat(newPlatformUrlForUserMenu, "/overview");
288
+ }
289
+ }, "Dashboard")), /*#__PURE__*/_react.default.createElement(_Header.UserAccount, null, /*#__PURE__*/_react.default.createElement(_Header.UserButton, {
284
290
  onClick: function onClick() {
285
291
  return toggleMenu('main');
286
292
  }
@@ -288,7 +294,7 @@ var Header = function Header(_ref3) {
288
294
  avatar: userPhoto
289
295
  })), checkTodoStatus(user) > 0 && /*#__PURE__*/_react.default.createElement(_NotificationCounter.default, {
290
296
  avatar: true
291
- }, checkTodoStatus(user)))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, withoutLoginSignupButton ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_breakdown.default, null, /*#__PURE__*/_react.default.createElement(_Header.LoginButton, {
297
+ }, checkTodoStatus(user))))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, withoutLoginSignupButton ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_breakdown.default, null, /*#__PURE__*/_react.default.createElement(_Header.LoginButton, {
292
298
  onClick: onLoginClick
293
299
  }, "Log in")), /*#__PURE__*/_react.default.createElement(_Header.SignupButton, {
294
300
  onClick: onSignUpClick
@@ -333,7 +339,7 @@ var Header = function Header(_ref3) {
333
339
  return toggleMenu('main');
334
340
  }
335
341
  }, "Dashboard"))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Header.MobileMenuItem, null, /*#__PURE__*/_react.default.createElement("a", {
336
- href: checkTodoStatus(user) > 0 ? "".concat(newPlatformUrlForUserMenu, "/checklist") : "".concat(newPlatformUrlForUserMenu, "/"),
342
+ href: checkTodoStatus(user) > 0 ? "".concat(newPlatformUrlForUserMenu, "/checklist") : "".concat(newPlatformUrlForUserMenu, "/overview"),
337
343
  onClick: function onClick() {
338
344
  return toggleMenu('main');
339
345
  }
@@ -152,11 +152,11 @@ var MainMenu = /*#__PURE__*/function (_PureComponent) {
152
152
  as: "button",
153
153
  button: true,
154
154
  onClick: function onClick() {
155
- return notifications > 0 ? window.location.href = "".concat(platformUrlForUserMenu, "/checklist") : window.location.href = "".concat(platformUrlForUserMenu, "/");
155
+ window.location.href = "".concat(platformUrlForUserMenu, "/checklist");
156
156
  }
157
157
  }, /*#__PURE__*/_react.default.createElement("span", {
158
158
  style: spanStyleForMenu
159
- }, "Dashboard"), notifications > 0 && /*#__PURE__*/_react.default.createElement(_MainMenu.Notifications, null, notifications)), /*#__PURE__*/_react.default.createElement(_MainMenu.MainMenuOption, {
159
+ }, "Checklist"), notifications > 0 && /*#__PURE__*/_react.default.createElement(_MainMenu.Notifications, null, notifications)), /*#__PURE__*/_react.default.createElement(_MainMenu.MainMenuOption, {
160
160
  as: "button",
161
161
  button: true,
162
162
  isOpened: isSettingsActive,
@@ -42,18 +42,20 @@ var Auth = /*#__PURE__*/function () {
42
42
  value: function logout() {
43
43
  var cookieDomain = (0, _getCookieDomain.default)();
44
44
  _jsCookie.default.remove('STOKR_ACCESS_TOKEN', cookieDomain);
45
- (0, _auth.signOut)(_firebaseConfig.auth).then(function () {
46
- console.log('logged out');
47
- });
48
45
  }
49
46
  }, {
50
47
  key: "login",
51
48
  value: function login(email, password) {
52
49
  return new Promise(function (resolve, reject) {
53
50
  (0, _auth.signInWithEmailAndPassword)(_firebaseConfig.auth, email, password).then(function (userCredential) {
54
- // Signed in
51
+ console.log('🚀 ~ userCredential:', userCredential);
55
52
  var user = userCredential.user;
56
53
  resolve(user);
54
+ // return user.getIdToken().then((idToken) => {
55
+ // console.log('🚀 ~ idToken:', idToken)
56
+ // // const csrfToken=getCookie('csrfToken')
57
+ // })
58
+ // Signed in
57
59
  }).catch(function (error) {
58
60
  reject(error);
59
61
  });
@@ -11,6 +11,8 @@ var _Auth = _interopRequireDefault(require("./Auth"));
11
11
  var _withRouter = require("../utils/withRouter");
12
12
  var _avatarPlaceholder = _interopRequireDefault(require("../static/images/avatar-placeholder.png"));
13
13
  var _auth = require("firebase/auth");
14
+ var _firebaseConfig = require("../firebase-config");
15
+ var _fetchData = _interopRequireDefault(require("../api/fetchData"));
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
  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); }
16
18
  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; }
@@ -67,7 +69,7 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
67
69
  });
68
70
  _defineProperty(_assertThisInitialized(_this), "loginUser", /*#__PURE__*/function () {
69
71
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(email, password) {
70
- var user;
72
+ var user, idToken, sessionLogin;
71
73
  return _regeneratorRuntime().wrap(function _callee$(_context) {
72
74
  while (1) switch (_context.prev = _context.next) {
73
75
  case 0:
@@ -77,44 +79,55 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
77
79
  case 3:
78
80
  user = _context.sent;
79
81
  console.log('🚀 ~ file: AuthContext.js:50 ~ user:', user);
82
+ _context.next = 7;
83
+ return user.getIdToken();
84
+ case 7:
85
+ idToken = _context.sent;
80
86
  _Auth.default.setAccessToken(user.accessToken);
87
+ _context.next = 11;
88
+ return (0, _fetchData.default)('auth/session-login', {
89
+ idToken: idToken
90
+ });
91
+ case 11:
92
+ sessionLogin = _context.sent;
93
+ console.log('🚀 ~ sessionLogin:', sessionLogin);
81
94
  _this.setState({
82
95
  firebaseUser: user,
83
96
  isFetchingUser: false
84
97
  });
85
98
  //if you need user immediatly
86
99
  return _context.abrupt("return", user);
87
- case 10:
88
- _context.prev = 10;
100
+ case 17:
101
+ _context.prev = 17;
89
102
  _context.t0 = _context["catch"](0);
90
103
  console.log('🚀 ~ file: AuthContext.js:56 ~ error:', _context.t0);
91
104
  _context.t1 = _context.t0.code;
92
- _context.next = _context.t1 === 'auth/multi-factor-auth-required' ? 16 : _context.t1 === 'auth/requires-recent-login' ? 18 : _context.t1 === 'auth/invalid-login-credentials' ? 20 : 22;
105
+ _context.next = _context.t1 === 'auth/multi-factor-auth-required' ? 23 : _context.t1 === 'auth/requires-recent-login' ? 25 : _context.t1 === 'auth/invalid-login-credentials' ? 27 : 29;
93
106
  break;
94
- case 16:
107
+ case 23:
95
108
  // Initiate your second factor sign-in flow. (See next step.)
96
109
  _this.setState({
97
110
  waitingFor2fa: true,
98
111
  firebaseError: _context.t0
99
112
  });
100
113
  throw _context.t0;
101
- case 18:
114
+ case 25:
102
115
  // The user's last sign-in time does not meet the security threshold.
103
116
  _this.logoutUser();
104
- return _context.abrupt("break", 25);
105
- case 20:
117
+ return _context.abrupt("break", 32);
118
+ case 27:
106
119
  _context.t0.message = 'The credentials are not correct. Try again?';
107
120
  throw _context.t0;
108
- case 22:
121
+ case 29:
109
122
  console.log({
110
123
  error: _context.t0
111
124
  }); // Handle other errors, such as wrong passwords.
112
125
  throw _context.t0;
113
- case 25:
126
+ case 32:
114
127
  case "end":
115
128
  return _context.stop();
116
129
  }
117
- }, _callee, null, [[0, 10]]);
130
+ }, _callee, null, [[0, 17]]);
118
131
  }));
119
132
  return function (_x, _x2) {
120
133
  return _ref.apply(this, arguments);
@@ -326,20 +339,36 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
326
339
  return _ref6.apply(this, arguments);
327
340
  };
328
341
  }());
329
- _defineProperty(_assertThisInitialized(_this), "logoutUser", function () {
330
- var redirect = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
331
- _Auth.default.logout();
332
- delete _axios.default.defaults.headers.common.Authorization;
333
- _this.setUser(null);
334
- _this.setState({
335
- firebaseUser: null,
336
- firebaseError: null,
337
- verifyEmailError: null
338
- });
339
- if (redirect) {
340
- window.location.href = "https://".concat(process.env.REACT_APP_WEBSITE_DOMAIN);
341
- }
342
- });
342
+ _defineProperty(_assertThisInitialized(_this), "logoutUser", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
343
+ var redirect,
344
+ _args7 = arguments;
345
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
346
+ while (1) switch (_context7.prev = _context7.next) {
347
+ case 0:
348
+ redirect = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : false;
349
+ (0, _auth.signOut)(_firebaseConfig.auth).then(function () {
350
+ console.log('logged out');
351
+ });
352
+ _context7.next = 4;
353
+ return (0, _fetchData.default)('auth/session-logout');
354
+ case 4:
355
+ _Auth.default.logout();
356
+ delete _axios.default.defaults.headers.common.Authorization;
357
+ _this.setUser(null);
358
+ _this.setState({
359
+ firebaseUser: null,
360
+ firebaseError: null,
361
+ verifyEmailError: null
362
+ });
363
+ if (redirect) {
364
+ window.location.href = "https://".concat(process.env.REACT_APP_WEBSITE_DOMAIN);
365
+ }
366
+ case 9:
367
+ case "end":
368
+ return _context7.stop();
369
+ }
370
+ }, _callee7);
371
+ })));
343
372
  _defineProperty(_assertThisInitialized(_this), "patchUserObject", function (user, firebaseUser) {
344
373
  if (!user || !firebaseUser) return;
345
374
 
@@ -350,45 +379,45 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
350
379
  //user object will override any properties that are the same in the firebaseUser
351
380
  return Object.assign(firebaseUser, user);
352
381
  });
353
- _defineProperty(_assertThisInitialized(_this), "getUser", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
382
+ _defineProperty(_assertThisInitialized(_this), "getUser", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
354
383
  var accessToken,
355
384
  customValidateGetUser,
356
385
  result,
357
386
  firebaseUser,
358
387
  user,
359
388
  userAvatar,
360
- _args7 = arguments;
361
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
362
- while (1) switch (_context7.prev = _context7.next) {
389
+ _args8 = arguments;
390
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
391
+ while (1) switch (_context8.prev = _context8.next) {
363
392
  case 0:
364
- accessToken = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : _Auth.default.getAccessToken();
393
+ accessToken = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : _Auth.default.getAccessToken();
365
394
  if (accessToken) {
366
- _context7.next = 4;
395
+ _context8.next = 4;
367
396
  break;
368
397
  }
369
398
  _this.setState({
370
399
  isFetchingUser: false
371
400
  });
372
- return _context7.abrupt("return");
401
+ return _context8.abrupt("return");
373
402
  case 4:
374
403
  _axios.default.defaults.headers.common.Authorization = "Bearer ".concat(accessToken);
375
404
 
376
405
  //pass this function as a prop if you need any custom logic after user/get
377
406
  customValidateGetUser = _this.props.customValidateGetUser;
378
- _context7.prev = 6;
379
- _context7.next = 9;
407
+ _context8.prev = 6;
408
+ _context8.next = 9;
380
409
  return _Auth.default.getUser();
381
410
  case 9:
382
- result = _context7.sent;
411
+ result = _context8.sent;
383
412
  firebaseUser = _this.state.firebaseUser;
384
413
  if (firebaseUser) {
385
- _context7.next = 15;
414
+ _context8.next = 15;
386
415
  break;
387
416
  }
388
- _context7.next = 14;
417
+ _context8.next = 14;
389
418
  return _Auth.default.getFirebaseUser();
390
419
  case 14:
391
- firebaseUser = _context7.sent;
420
+ firebaseUser = _context8.sent;
392
421
  case 15:
393
422
  //merge firebaseUser and our user object
394
423
  user = _this.patchUserObject(result.user, firebaseUser);
@@ -409,20 +438,20 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
409
438
  _this.replaceLocationPathName();
410
439
 
411
440
  //if you need user info immediately after call (before setState is executed), you can use this
412
- return _context7.abrupt("return", user);
441
+ return _context8.abrupt("return", user);
413
442
  case 27:
414
- _context7.prev = 27;
415
- _context7.t0 = _context7["catch"](6);
443
+ _context8.prev = 27;
444
+ _context8.t0 = _context8["catch"](6);
416
445
  _this.setState({
417
446
  isFetchingUser: false
418
447
  });
419
- console.log("Error in getUser: ".concat(_context7.t0));
420
- throw _context7.t0;
448
+ console.log("Error in getUser: ".concat(_context8.t0));
449
+ throw _context8.t0;
421
450
  case 32:
422
451
  case "end":
423
- return _context7.stop();
452
+ return _context8.stop();
424
453
  }
425
- }, _callee7, null, [[6, 27]]);
454
+ }, _callee8, null, [[6, 27]]);
426
455
  })));
427
456
  _defineProperty(_assertThisInitialized(_this), "checkUserPhoto", function (avatar) {
428
457
  try {
@@ -456,63 +485,63 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
456
485
  });
457
486
  _defineProperty(_assertThisInitialized(_this), "uploadPhoto", function (file) {
458
487
  return new Promise( /*#__PURE__*/function () {
459
- var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(resolve, reject) {
488
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(resolve, reject) {
460
489
  var user, formData, result;
461
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
462
- while (1) switch (_context8.prev = _context8.next) {
490
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
491
+ while (1) switch (_context9.prev = _context9.next) {
463
492
  case 0:
464
- _context8.prev = 0;
493
+ _context9.prev = 0;
465
494
  user = _this.state.user;
466
495
  if (!(!user || !file)) {
467
- _context8.next = 4;
496
+ _context9.next = 4;
468
497
  break;
469
498
  }
470
- return _context8.abrupt("return");
499
+ return _context9.abrupt("return");
471
500
  case 4:
472
501
  formData = new FormData();
473
502
  formData.append('userId', user._id);
474
503
  formData.append('file', file);
475
- _context8.next = 9;
504
+ _context9.next = 9;
476
505
  return _Auth.default.uploadPhoto(formData);
477
506
  case 9:
478
- result = _context8.sent;
507
+ result = _context9.sent;
479
508
  _this.setState({
480
509
  avatar: "".concat(process.env.REACT_APP_PHOTO_API_URL, "/media/picture/view/").concat(user._id, "?ignore=").concat(Date.now())
481
510
  });
482
511
  resolve(result);
483
- _context8.next = 18;
512
+ _context9.next = 18;
484
513
  break;
485
514
  case 14:
486
- _context8.prev = 14;
487
- _context8.t0 = _context8["catch"](0);
488
- console.log("Error: ".concat(_context8.t0));
489
- reject(_context8.t0);
515
+ _context9.prev = 14;
516
+ _context9.t0 = _context9["catch"](0);
517
+ console.log("Error: ".concat(_context9.t0));
518
+ reject(_context9.t0);
490
519
  case 18:
491
520
  case "end":
492
- return _context8.stop();
521
+ return _context9.stop();
493
522
  }
494
- }, _callee8, null, [[0, 14]]);
523
+ }, _callee9, null, [[0, 14]]);
495
524
  }));
496
525
  return function (_x12, _x13) {
497
- return _ref8.apply(this, arguments);
526
+ return _ref9.apply(this, arguments);
498
527
  };
499
528
  }());
500
529
  });
501
- _defineProperty(_assertThisInitialized(_this), "deletePhoto", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
530
+ _defineProperty(_assertThisInitialized(_this), "deletePhoto", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
502
531
  var user, formData;
503
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
504
- while (1) switch (_context9.prev = _context9.next) {
532
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
533
+ while (1) switch (_context10.prev = _context10.next) {
505
534
  case 0:
506
535
  user = _this.state.user;
507
536
  if (user) {
508
- _context9.next = 3;
537
+ _context10.next = 3;
509
538
  break;
510
539
  }
511
- return _context9.abrupt("return");
540
+ return _context10.abrupt("return");
512
541
  case 3:
513
542
  formData = new FormData();
514
543
  formData.append('userId', user._id);
515
- _context9.next = 7;
544
+ _context10.next = 7;
516
545
  return _Auth.default.deletePhoto(formData);
517
546
  case 7:
518
547
  _this.setState({
@@ -520,9 +549,9 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
520
549
  });
521
550
  case 8:
522
551
  case "end":
523
- return _context9.stop();
552
+ return _context10.stop();
524
553
  }
525
- }, _callee9);
554
+ }, _callee10);
526
555
  })));
527
556
  _defineProperty(_assertThisInitialized(_this), "replaceLocationPathName", function () {
528
557
  var pathname = _this.props.location.pathname;
@@ -531,162 +560,162 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
531
560
  }
532
561
  });
533
562
  _defineProperty(_assertThisInitialized(_this), "updateUser", /*#__PURE__*/function () {
534
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(data) {
563
+ var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(data) {
535
564
  var _yield$Auth$updateUse, user;
536
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
537
- while (1) switch (_context10.prev = _context10.next) {
565
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
566
+ while (1) switch (_context11.prev = _context11.next) {
538
567
  case 0:
539
- _context10.prev = 0;
540
- _context10.next = 3;
568
+ _context11.prev = 0;
569
+ _context11.next = 3;
541
570
  return _Auth.default.updateUser(data);
542
571
  case 3:
543
- _yield$Auth$updateUse = _context10.sent;
572
+ _yield$Auth$updateUse = _context11.sent;
544
573
  user = _yield$Auth$updateUse.user;
545
574
  _this.setUser(user);
546
- return _context10.abrupt("return", user);
575
+ return _context11.abrupt("return", user);
547
576
  case 9:
548
- _context10.prev = 9;
549
- _context10.t0 = _context10["catch"](0);
550
- console.log("Error updating the user: ".concat(_context10.t0));
551
- throw _context10.t0;
577
+ _context11.prev = 9;
578
+ _context11.t0 = _context11["catch"](0);
579
+ console.log("Error updating the user: ".concat(_context11.t0));
580
+ throw _context11.t0;
552
581
  case 13:
553
582
  case "end":
554
- return _context10.stop();
583
+ return _context11.stop();
555
584
  }
556
- }, _callee10, null, [[0, 9]]);
585
+ }, _callee11, null, [[0, 9]]);
557
586
  }));
558
587
  return function (_x14) {
559
- return _ref10.apply(this, arguments);
588
+ return _ref11.apply(this, arguments);
560
589
  };
561
590
  }());
562
591
  _defineProperty(_assertThisInitialized(_this), "checkIfPrivateInvestor", /*#__PURE__*/function () {
563
- var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(project) {
592
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(project) {
564
593
  var user,
565
594
  returnData,
566
595
  dataToSend,
567
596
  isPrivateInvestor,
568
597
  userCopy,
569
- _args11 = arguments;
570
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
571
- while (1) switch (_context11.prev = _context11.next) {
598
+ _args12 = arguments;
599
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
600
+ while (1) switch (_context12.prev = _context12.next) {
572
601
  case 0:
573
- user = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : _this.state.user;
574
- returnData = _args11.length > 2 && _args11[2] !== undefined ? _args11[2] : false;
602
+ user = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : _this.state.user;
603
+ returnData = _args12.length > 2 && _args12[2] !== undefined ? _args12[2] : false;
575
604
  if (!(!user || !project)) {
576
- _context11.next = 4;
605
+ _context12.next = 4;
577
606
  break;
578
607
  }
579
- return _context11.abrupt("return");
608
+ return _context12.abrupt("return");
580
609
  case 4:
581
- _context11.prev = 4;
610
+ _context12.prev = 4;
582
611
  dataToSend = {
583
612
  userId: user._id,
584
613
  projectId: project._id
585
614
  };
586
- _context11.next = 8;
615
+ _context12.next = 8;
587
616
  return _Auth.default.checkPrivateInvestor(dataToSend);
588
617
  case 8:
589
- isPrivateInvestor = _context11.sent;
618
+ isPrivateInvestor = _context12.sent;
590
619
  userCopy = _objectSpread({}, user);
591
620
  userCopy.isPrivateInvestor = isPrivateInvestor.isAllowed;
592
621
  userCopy.privateInvestorStatus = isPrivateInvestor.status;
593
622
  if (!returnData) {
594
- _context11.next = 16;
623
+ _context12.next = 16;
595
624
  break;
596
625
  }
597
- return _context11.abrupt("return", userCopy);
626
+ return _context12.abrupt("return", userCopy);
598
627
  case 16:
599
628
  _this.setState({
600
629
  user: userCopy
601
630
  });
602
631
  case 17:
603
- _context11.next = 23;
632
+ _context12.next = 23;
604
633
  break;
605
634
  case 19:
606
- _context11.prev = 19;
607
- _context11.t0 = _context11["catch"](4);
608
- console.log('🚀 ~ error in checkPrivateInvestor', _context11.t0);
609
- throw _context11.t0;
635
+ _context12.prev = 19;
636
+ _context12.t0 = _context12["catch"](4);
637
+ console.log('🚀 ~ error in checkPrivateInvestor', _context12.t0);
638
+ throw _context12.t0;
610
639
  case 23:
611
640
  case "end":
612
- return _context11.stop();
641
+ return _context12.stop();
613
642
  }
614
- }, _callee11, null, [[4, 19]]);
643
+ }, _callee12, null, [[4, 19]]);
615
644
  }));
616
645
  return function (_x15) {
617
- return _ref11.apply(this, arguments);
646
+ return _ref12.apply(this, arguments);
618
647
  };
619
648
  }());
620
649
  _defineProperty(_assertThisInitialized(_this), "checkIfUserSubscribed", /*#__PURE__*/function () {
621
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(project) {
650
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(project) {
622
651
  var user,
623
652
  returnData,
624
653
  dataToSend,
625
654
  isSubscribed,
626
655
  userCopy,
627
- _args12 = arguments;
628
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
629
- while (1) switch (_context12.prev = _context12.next) {
656
+ _args13 = arguments;
657
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
658
+ while (1) switch (_context13.prev = _context13.next) {
630
659
  case 0:
631
- user = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : _this.state.user;
632
- returnData = _args12.length > 2 && _args12[2] !== undefined ? _args12[2] : false;
660
+ user = _args13.length > 1 && _args13[1] !== undefined ? _args13[1] : _this.state.user;
661
+ returnData = _args13.length > 2 && _args13[2] !== undefined ? _args13[2] : false;
633
662
  if (!(!user || !project)) {
634
- _context12.next = 4;
663
+ _context13.next = 4;
635
664
  break;
636
665
  }
637
- return _context12.abrupt("return");
666
+ return _context13.abrupt("return");
638
667
  case 4:
639
- _context12.prev = 4;
668
+ _context13.prev = 4;
640
669
  dataToSend = {
641
670
  listName: project.name,
642
671
  email: user.email
643
672
  };
644
- _context12.next = 8;
673
+ _context13.next = 8;
645
674
  return _Auth.default.checkIfUserSubscribed(dataToSend);
646
675
  case 8:
647
- isSubscribed = _context12.sent;
676
+ isSubscribed = _context13.sent;
648
677
  userCopy = _objectSpread({}, user);
649
678
  userCopy.isSubscribed = isSubscribed;
650
679
  if (!returnData) {
651
- _context12.next = 15;
680
+ _context13.next = 15;
652
681
  break;
653
682
  }
654
- return _context12.abrupt("return", userCopy);
683
+ return _context13.abrupt("return", userCopy);
655
684
  case 15:
656
685
  _this.setState({
657
686
  user: userCopy
658
687
  });
659
688
  case 16:
660
- _context12.next = 22;
689
+ _context13.next = 22;
661
690
  break;
662
691
  case 18:
663
- _context12.prev = 18;
664
- _context12.t0 = _context12["catch"](4);
665
- console.log('🚀 ~ error in checkIfUserSubscribed', _context12.t0);
666
- throw _context12.t0;
692
+ _context13.prev = 18;
693
+ _context13.t0 = _context13["catch"](4);
694
+ console.log('🚀 ~ error in checkIfUserSubscribed', _context13.t0);
695
+ throw _context13.t0;
667
696
  case 22:
668
697
  case "end":
669
- return _context12.stop();
698
+ return _context13.stop();
670
699
  }
671
- }, _callee12, null, [[4, 18]]);
700
+ }, _callee13, null, [[4, 18]]);
672
701
  }));
673
702
  return function (_x16) {
674
- return _ref12.apply(this, arguments);
703
+ return _ref13.apply(this, arguments);
675
704
  };
676
705
  }());
677
- _defineProperty(_assertThisInitialized(_this), "handleVerifyEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
706
+ _defineProperty(_assertThisInitialized(_this), "handleVerifyEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
678
707
  var location, query, oobCode, email;
679
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
680
- while (1) switch (_context13.prev = _context13.next) {
708
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
709
+ while (1) switch (_context14.prev = _context14.next) {
681
710
  case 0:
682
711
  _this.setState({
683
712
  isVerifyingEmail: true
684
713
  });
685
714
  location = _this.props.location;
686
715
  query = new URLSearchParams(location.search);
687
- _context13.prev = 3;
716
+ _context14.prev = 3;
688
717
  oobCode = query.get('oobCode');
689
- _context13.next = 7;
718
+ _context14.next = 7;
690
719
  return _Auth.default.handleVerifyEmail(oobCode);
691
720
  case 7:
692
721
  _this.setState({
@@ -696,188 +725,188 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
696
725
  //proceed to signup flow immediately after success
697
726
  window.location.href = "https://signup.".concat(process.env.REACT_APP_WEBSITE_DOMAIN, "/welcome");
698
727
  // this.getUser()
699
- _context13.next = 27;
728
+ _context14.next = 27;
700
729
  break;
701
730
  case 11:
702
- _context13.prev = 11;
703
- _context13.t0 = _context13["catch"](3);
704
- _context13.t1 = _context13.t0 === null || _context13.t0 === void 0 ? void 0 : _context13.t0.code;
705
- _context13.next = _context13.t1 === 'auth/expired-action-code' ? 16 : _context13.t1 === 'auth/invalid-action-code' ? 20 : _context13.t1 === 'auth/user-disabled' ? 22 : 24;
731
+ _context14.prev = 11;
732
+ _context14.t0 = _context14["catch"](3);
733
+ _context14.t1 = _context14.t0 === null || _context14.t0 === void 0 ? void 0 : _context14.t0.code;
734
+ _context14.next = _context14.t1 === 'auth/expired-action-code' ? 16 : _context14.t1 === 'auth/invalid-action-code' ? 20 : _context14.t1 === 'auth/user-disabled' ? 22 : 24;
706
735
  break;
707
736
  case 16:
708
- _context13.t0.message = 'The activation link has expired. We are sending you a new one right now.';
737
+ _context14.t0.message = 'The activation link has expired. We are sending you a new one right now.';
709
738
  email = query.get('email');
710
739
  if (email) {
711
- _context13.t0.email = email;
740
+ _context14.t0.email = email;
712
741
  //Auth.resendActivationEmail(email)
713
742
  }
714
- return _context13.abrupt("break", 25);
743
+ return _context14.abrupt("break", 25);
715
744
  case 20:
716
- _context13.t0.message = 'This link is invalid. Please try verifying email again.';
717
- return _context13.abrupt("break", 25);
745
+ _context14.t0.message = 'This link is invalid. Please try verifying email again.';
746
+ return _context14.abrupt("break", 25);
718
747
  case 22:
719
- _context13.t0.message = 'Your account has been disabled. Please contact our support.';
720
- return _context13.abrupt("break", 25);
748
+ _context14.t0.message = 'Your account has been disabled. Please contact our support.';
749
+ return _context14.abrupt("break", 25);
721
750
  case 24:
722
- return _context13.abrupt("break", 25);
751
+ return _context14.abrupt("break", 25);
723
752
  case 25:
724
- console.log('🚀 ~ file: AuthContext.js:446 ~ error:', _context13.t0);
753
+ console.log('🚀 ~ file: AuthContext.js:446 ~ error:', _context14.t0);
725
754
  _this.setState({
726
- verifyEmailError: _context13.t0,
755
+ verifyEmailError: _context14.t0,
727
756
  isVerifyingEmail: false,
728
757
  isFetchingUser: false
729
758
  });
730
759
  //throw error
731
760
  case 27:
732
761
  case "end":
733
- return _context13.stop();
762
+ return _context14.stop();
734
763
  }
735
- }, _callee13, null, [[3, 11]]);
764
+ }, _callee14, null, [[3, 11]]);
736
765
  })));
737
766
  _defineProperty(_assertThisInitialized(_this), "handleResetPassword", /*#__PURE__*/function () {
738
- var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(password) {
767
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(password) {
739
768
  var location, query, oobCode;
740
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
741
- while (1) switch (_context14.prev = _context14.next) {
769
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
770
+ while (1) switch (_context15.prev = _context15.next) {
742
771
  case 0:
743
772
  location = _this.props.location;
744
- _context14.prev = 1;
773
+ _context15.prev = 1;
745
774
  query = new URLSearchParams(location.search);
746
775
  oobCode = query.get('oobCode');
747
- _context14.next = 6;
776
+ _context15.next = 6;
748
777
  return _Auth.default.handleResetPassword(oobCode, password);
749
778
  case 6:
750
- _context14.next = 21;
779
+ _context15.next = 21;
751
780
  break;
752
781
  case 8:
753
- _context14.prev = 8;
754
- _context14.t0 = _context14["catch"](1);
755
- _context14.t1 = _context14.t0 === null || _context14.t0 === void 0 ? void 0 : _context14.t0.code;
756
- _context14.next = _context14.t1 === 'auth/expired-action-code' ? 13 : _context14.t1 === 'auth/invalid-action-code' ? 15 : _context14.t1 === 'auth/user-disabled' ? 17 : 19;
782
+ _context15.prev = 8;
783
+ _context15.t0 = _context15["catch"](1);
784
+ _context15.t1 = _context15.t0 === null || _context15.t0 === void 0 ? void 0 : _context15.t0.code;
785
+ _context15.next = _context15.t1 === 'auth/expired-action-code' ? 13 : _context15.t1 === 'auth/invalid-action-code' ? 15 : _context15.t1 === 'auth/user-disabled' ? 17 : 19;
757
786
  break;
758
787
  case 13:
759
- _context14.t0.message = 'This link has expired. Please try reseting password again.';
760
- return _context14.abrupt("break", 20);
788
+ _context15.t0.message = 'This link has expired. Please try reseting password again.';
789
+ return _context15.abrupt("break", 20);
761
790
  case 15:
762
- _context14.t0.message = 'This link is invalid. Please try reseting password again.';
763
- return _context14.abrupt("break", 20);
791
+ _context15.t0.message = 'This link is invalid. Please try reseting password again.';
792
+ return _context15.abrupt("break", 20);
764
793
  case 17:
765
- _context14.t0.message = 'Your account has been disabled. Please contact our support.';
766
- return _context14.abrupt("break", 20);
794
+ _context15.t0.message = 'Your account has been disabled. Please contact our support.';
795
+ return _context15.abrupt("break", 20);
767
796
  case 19:
768
- return _context14.abrupt("break", 20);
797
+ return _context15.abrupt("break", 20);
769
798
  case 20:
770
- throw _context14.t0;
799
+ throw _context15.t0;
771
800
  case 21:
772
801
  case "end":
773
- return _context14.stop();
802
+ return _context15.stop();
774
803
  }
775
- }, _callee14, null, [[1, 8]]);
804
+ }, _callee15, null, [[1, 8]]);
776
805
  }));
777
806
  return function (_x17) {
778
- return _ref14.apply(this, arguments);
807
+ return _ref15.apply(this, arguments);
779
808
  };
780
809
  }());
781
- _defineProperty(_assertThisInitialized(_this), "sendWelcomeEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
782
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
783
- while (1) switch (_context15.prev = _context15.next) {
810
+ _defineProperty(_assertThisInitialized(_this), "sendWelcomeEmail", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
811
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
812
+ while (1) switch (_context16.prev = _context16.next) {
784
813
  case 0:
785
- _context15.prev = 0;
786
- _context15.next = 3;
814
+ _context16.prev = 0;
815
+ _context16.next = 3;
787
816
  return _Auth.default.sendWelcomeEmail();
788
817
  case 3:
789
- _context15.next = 8;
818
+ _context16.next = 8;
790
819
  break;
791
820
  case 5:
792
- _context15.prev = 5;
793
- _context15.t0 = _context15["catch"](0);
794
- console.log("Error sending welcome email: ".concat(_context15.t0));
821
+ _context16.prev = 5;
822
+ _context16.t0 = _context16["catch"](0);
823
+ console.log("Error sending welcome email: ".concat(_context16.t0));
795
824
  // No need to throw error, let the app continue even if it fails
796
825
  case 8:
797
826
  case "end":
798
- return _context15.stop();
827
+ return _context16.stop();
799
828
  }
800
- }, _callee15, null, [[0, 5]]);
829
+ }, _callee16, null, [[0, 5]]);
801
830
  })));
802
831
  _defineProperty(_assertThisInitialized(_this), "uploaProofOfAddress", /*#__PURE__*/function () {
803
- var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(data, ip) {
832
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(data, ip) {
804
833
  var user;
805
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
806
- while (1) switch (_context16.prev = _context16.next) {
834
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
835
+ while (1) switch (_context17.prev = _context17.next) {
807
836
  case 0:
808
- _context16.prev = 0;
809
- _context16.next = 3;
837
+ _context17.prev = 0;
838
+ _context17.next = 3;
810
839
  return _Auth.default.uploaProofOfAddress(data, ip);
811
840
  case 3:
812
- user = _context16.sent;
841
+ user = _context17.sent;
813
842
  _this.setUser(user);
814
- _context16.next = 11;
843
+ _context17.next = 11;
815
844
  break;
816
845
  case 7:
817
- _context16.prev = 7;
818
- _context16.t0 = _context16["catch"](0);
819
- console.log("Error uploading proof of address: ".concat(_context16.t0));
820
- throw _context16.t0;
846
+ _context17.prev = 7;
847
+ _context17.t0 = _context17["catch"](0);
848
+ console.log("Error uploading proof of address: ".concat(_context17.t0));
849
+ throw _context17.t0;
821
850
  case 11:
822
851
  case "end":
823
- return _context16.stop();
852
+ return _context17.stop();
824
853
  }
825
- }, _callee16, null, [[0, 7]]);
854
+ }, _callee17, null, [[0, 7]]);
826
855
  }));
827
856
  return function (_x18, _x19) {
828
- return _ref16.apply(this, arguments);
857
+ return _ref17.apply(this, arguments);
829
858
  };
830
859
  }());
831
860
  _defineProperty(_assertThisInitialized(_this), "validateGreenWalletId", /*#__PURE__*/function () {
832
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(id) {
833
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
834
- while (1) switch (_context17.prev = _context17.next) {
861
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(id) {
862
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
863
+ while (1) switch (_context18.prev = _context18.next) {
835
864
  case 0:
836
- _context17.prev = 0;
837
- _context17.next = 3;
865
+ _context18.prev = 0;
866
+ _context18.next = 3;
838
867
  return _Auth.default.validateGreenWalletId(id);
839
868
  case 3:
840
- return _context17.abrupt("return", _context17.sent);
869
+ return _context18.abrupt("return", _context18.sent);
841
870
  case 6:
842
- _context17.prev = 6;
843
- _context17.t0 = _context17["catch"](0);
844
- console.log("Error validating Green Wallet ID: ".concat(_context17.t0));
845
- throw _context17.t0;
871
+ _context18.prev = 6;
872
+ _context18.t0 = _context18["catch"](0);
873
+ console.log("Error validating Green Wallet ID: ".concat(_context18.t0));
874
+ throw _context18.t0;
846
875
  case 10:
847
876
  case "end":
848
- return _context17.stop();
877
+ return _context18.stop();
849
878
  }
850
- }, _callee17, null, [[0, 6]]);
879
+ }, _callee18, null, [[0, 6]]);
851
880
  }));
852
881
  return function (_x20) {
853
- return _ref17.apply(this, arguments);
882
+ return _ref18.apply(this, arguments);
854
883
  };
855
884
  }());
856
885
  _defineProperty(_assertThisInitialized(_this), "createWallet", /*#__PURE__*/function () {
857
- var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(data) {
886
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(data) {
858
887
  var wallet;
859
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
860
- while (1) switch (_context18.prev = _context18.next) {
888
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
889
+ while (1) switch (_context19.prev = _context19.next) {
861
890
  case 0:
862
- _context18.prev = 0;
863
- _context18.next = 3;
891
+ _context19.prev = 0;
892
+ _context19.next = 3;
864
893
  return _Auth.default.createWallet(data);
865
894
  case 3:
866
- wallet = _context18.sent;
867
- return _context18.abrupt("return", wallet);
895
+ wallet = _context19.sent;
896
+ return _context19.abrupt("return", wallet);
868
897
  case 7:
869
- _context18.prev = 7;
870
- _context18.t0 = _context18["catch"](0);
871
- console.log("Error creating wallet: ".concat(_context18.t0));
872
- throw _context18.t0;
898
+ _context19.prev = 7;
899
+ _context19.t0 = _context19["catch"](0);
900
+ console.log("Error creating wallet: ".concat(_context19.t0));
901
+ throw _context19.t0;
873
902
  case 11:
874
903
  case "end":
875
- return _context18.stop();
904
+ return _context19.stop();
876
905
  }
877
- }, _callee18, null, [[0, 7]]);
906
+ }, _callee19, null, [[0, 7]]);
878
907
  }));
879
908
  return function (_x21) {
880
- return _ref18.apply(this, arguments);
909
+ return _ref19.apply(this, arguments);
881
910
  };
882
911
  }());
883
912
  _defineProperty(_assertThisInitialized(_this), "setUser", function (user) {
@@ -889,12 +918,12 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
889
918
  });
890
919
  });
891
920
  _defineProperty(_assertThisInitialized(_this), "fetchLastTime", /*#__PURE__*/function () {
892
- var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(projectName, page, userId) {
921
+ var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(projectName, page, userId) {
893
922
  var filterBody, response;
894
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
895
- while (1) switch (_context19.prev = _context19.next) {
923
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
924
+ while (1) switch (_context20.prev = _context20.next) {
896
925
  case 0:
897
- _context19.prev = 0;
926
+ _context20.prev = 0;
898
927
  filterBody = {
899
928
  projectName: projectName,
900
929
  page: page
@@ -902,25 +931,25 @@ var AuthProviderClass = /*#__PURE__*/function (_Component) {
902
931
  if (userId) {
903
932
  filterBody.userId = userId;
904
933
  }
905
- _context19.next = 5;
934
+ _context20.next = 5;
906
935
  return _Auth.default.fetchTrackingUserLastTime({
907
936
  filter: filterBody
908
937
  });
909
938
  case 5:
910
- response = _context19.sent;
911
- return _context19.abrupt("return", response);
939
+ response = _context20.sent;
940
+ return _context20.abrupt("return", response);
912
941
  case 9:
913
- _context19.prev = 9;
914
- _context19.t0 = _context19["catch"](0);
915
- console.log(' error', _context19.t0);
942
+ _context20.prev = 9;
943
+ _context20.t0 = _context20["catch"](0);
944
+ console.log(' error', _context20.t0);
916
945
  case 12:
917
946
  case "end":
918
- return _context19.stop();
947
+ return _context20.stop();
919
948
  }
920
- }, _callee19, null, [[0, 9]]);
949
+ }, _callee20, null, [[0, 9]]);
921
950
  }));
922
951
  return function (_x22, _x23, _x24) {
923
- return _ref19.apply(this, arguments);
952
+ return _ref20.apply(this, arguments);
924
953
  };
925
954
  }());
926
955
  return _this;
@@ -21,6 +21,7 @@ var app = (0, _app.initializeApp)(firebaseConfig);
21
21
 
22
22
  // Initialize Firebase Authentication and get a reference to the service
23
23
  var auth = (0, _auth.getAuth)(app);
24
+ //setPersistence(auth, inMemoryPersistence)
24
25
  exports.auth = auth;
25
26
  var _default = app;
26
27
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "2.0.0-beta.25",
3
+ "version": "2.0.0-beta.26",
4
4
  "description": "STOKR - Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",