summit-registration-lite 3.0.15 → 3.0.18

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.
Files changed (3) hide show
  1. package/README.md +10 -9
  2. package/dist/index.js +193 -115
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -5,11 +5,11 @@ React component for the summit registration lite widget
5
5
  ## Registration Lite config
6
6
 
7
7
  **apiBaseUrl** = base url for API
8
-
8
+
9
9
  **summitData** = object with the data from the summit
10
-
10
+
11
11
  **profileData** = object with the profile data from the user
12
-
12
+
13
13
  **marketingData** = object with the settings from the marketing API
14
14
 
15
15
  **supportEmail** = string with the email address for support
@@ -30,7 +30,7 @@ React component for the summit registration lite widget
30
30
 
31
31
 
32
32
  Example
33
-
33
+
34
34
  ```
35
35
  [
36
36
  { button_color: '#082238', provider_label: 'FNid', provider_param: 'fnid' },
@@ -39,15 +39,15 @@ React component for the summit registration lite widget
39
39
  ```
40
40
 
41
41
  **authUser** = method passed that will be called on user login. param -> (provider) => console.log('login with', provider)
42
-
42
+
43
43
  **getAccessToken** = method passed that will be called to request the access token
44
-
44
+
45
45
  **closeWidget** = method passed that will be called if the user tries to close the widget
46
-
46
+
47
47
  **goToExtraQuestions** = method passed that will be called by component to redirect to extra questions page
48
48
 
49
49
  **goToEvent** = method passed that will be called to redirect the user to the current event
50
-
50
+
51
51
  **getPasswordlessCode** = method passed that will be called when the user generates a code to login without password
52
52
 
53
53
  **loginWithCode** = method passed that will be called when the user tries to login with a code
@@ -55,7 +55,8 @@ React component for the summit registration lite widget
55
55
  **onPurchaseComplete** = method passed that will be called after the purchase of a ticket it's completed
56
56
 
57
57
  **handleCompanyError** = method passed that will be called if the company dropdown can't be fetched
58
-
58
+
59
+ **authErrorCallback** = method passed that will handle on client any auth error
59
60
 
60
61
  ## PUBLISH TO NPM:
61
62
 
package/dist/index.js CHANGED
@@ -383,6 +383,7 @@ const START_WIDGET_LOADING = 'START_WIDGET_LOADING';
383
383
  const STOP_WIDGET_LOADING = 'STOP_WIDGET_LOADING';
384
384
  const LOAD_INITIAL_VARS = 'LOAD_INITIAL_VARS';
385
385
  const CHANGE_STEP = 'CHANGE_STEP';
386
+ const REQUESTED_TICKET_TYPES = 'REQUESTED_TICKET_TYPES';
386
387
  const GET_TICKET_TYPES = 'GET_TICKET_TYPES';
387
388
  const GET_TAX_TYPES = 'GET_TAX_TYPES';
388
389
  const CREATE_RESERVATION = 'CREATE_RESERVATION';
@@ -399,11 +400,15 @@ const SET_PASSWORDLESS_ERROR = 'SET_PASSWORDLESS_ERROR';
399
400
  const GO_TO_LOGIN = 'GO_TO_LOGIN';
400
401
  const GET_MY_INVITATION = 'GET_MY_INVITATION';
401
402
  const CLEAR_MY_INVITATION = 'CLEAR_MY_INVITATION';
403
+ const CLEAR_WIDGET_STATE = 'CLEAR_WIDGET_STATE';
402
404
  const startWidgetLoading = (0,actions_namespaceObject.createAction)(START_WIDGET_LOADING);
403
405
  const stopWidgetLoading = (0,actions_namespaceObject.createAction)(STOP_WIDGET_LOADING);
404
406
  const loadSession = settings => dispatch => {
405
407
  dispatch((0,actions_namespaceObject.createAction)(LOAD_INITIAL_VARS)(settings));
406
408
  };
409
+ const clearWidgetState = () => dispatch => {
410
+ dispatch((0,actions_namespaceObject.createAction)(CLEAR_WIDGET_STATE)({}));
411
+ };
407
412
 
408
413
  const customErrorHandler = (err, res) => (dispatch, state) => {
409
414
  if (err.timeout) {
@@ -446,7 +451,7 @@ const getTicketTypes = summitId => async (dispatch, getState, {
446
451
  access_token: accessToken
447
452
  };
448
453
  dispatch(startWidgetLoading());
449
- return (0,actions_namespaceObject.getRequest)(null, (0,actions_namespaceObject.createAction)(GET_TICKET_TYPES), `${apiBaseUrl}/api/v1/summits/${summitId}/ticket-types/allowed`, customErrorHandler)(params)(dispatch).then(() => {
454
+ return (0,actions_namespaceObject.getRequest)((0,actions_namespaceObject.createAction)(REQUESTED_TICKET_TYPES), (0,actions_namespaceObject.createAction)(GET_TICKET_TYPES), `${apiBaseUrl}/api/v1/summits/${summitId}/ticket-types/allowed`, customErrorHandler)(params)(dispatch).then(() => {
450
455
  dispatch(stopWidgetLoading());
451
456
  }).catch(error => {
452
457
  dispatch(stopWidgetLoading());
@@ -491,134 +496,152 @@ const reserveTicket = ({
491
496
  apiBaseUrl,
492
497
  getAccessToken
493
498
  }) => {
494
- const {
495
- registrationLiteState: {
496
- settings: {
497
- summitId
499
+ try {
500
+ const {
501
+ registrationLiteState: {
502
+ settings: {
503
+ summitId
504
+ }
498
505
  }
499
- }
500
- } = getState();
501
- let {
502
- firstName,
503
- lastName,
504
- email,
505
- company,
506
- promoCode
507
- } = personalInformation;
508
- dispatch(startWidgetLoading());
509
- const access_token = await getAccessToken();
510
- const tickets = [...Array(ticketQuantity)].map(() => ({
511
- type_id: ticket.id,
512
- promo_code: promoCode || null
513
- })); // Only set the attendee for the first ticket.
514
-
515
- tickets[0].attendee_first_name = firstName;
516
- tickets[0].attendee_last_name = lastName;
517
- tickets[0].attendee_email = email;
518
- let params = {
519
- access_token,
520
- expand: 'tickets,tickets.owner,tickets.ticket_type,tickets.ticket_type.taxes'
521
- };
522
- const normalizedEntity = normalizeReservation({
523
- owner_email: email,
524
- owner_first_name: firstName,
525
- owner_last_name: lastName,
526
- owner_company: company,
527
- tickets
528
- });
506
+ } = getState();
507
+ let {
508
+ firstName,
509
+ lastName,
510
+ email,
511
+ company,
512
+ promoCode
513
+ } = personalInformation;
514
+ dispatch(startWidgetLoading());
515
+ const access_token = await getAccessToken();
516
+ const tickets = [...Array(ticketQuantity)].map(() => ({
517
+ type_id: ticket.id,
518
+ promo_code: promoCode || null
519
+ })); // Only set the attendee for the first ticket.
520
+
521
+ tickets[0].attendee_first_name = firstName;
522
+ tickets[0].attendee_last_name = lastName;
523
+ tickets[0].attendee_email = email;
524
+ let params = {
525
+ access_token,
526
+ expand: 'tickets,tickets.owner,tickets.ticket_type,tickets.ticket_type.taxes'
527
+ };
528
+ const normalizedEntity = normalizeReservation({
529
+ owner_email: email,
530
+ owner_first_name: firstName,
531
+ owner_last_name: lastName,
532
+ owner_company: company,
533
+ tickets
534
+ });
529
535
 
530
- const errorHandler = (err, res) => (dispatch, state) => {
531
- if (res && res.statusCode === 412 && onError) return onError(err, res);
536
+ const errorHandler = (err, res) => (dispatch, state) => {
537
+ if (res && res.statusCode === 412 && onError) return onError(err, res);
532
538
 
533
- if (res && res.statusCode === 404) {
534
- const msg = res.body.message;
535
- external_sweetalert2_default().fire("Validation Error", msg, "warning");
536
- return;
537
- }
539
+ if (res && res.statusCode === 404) {
540
+ const msg = res.body.message;
541
+ external_sweetalert2_default().fire("Validation Error", msg, "warning");
542
+ return;
543
+ }
538
544
 
539
- if (res && res.statusCode === 500) {
540
- const msg = res.body.message;
541
- external_sweetalert2_default().fire("Server Error", msg, "error");
542
- return;
543
- }
545
+ if (res && res.statusCode === 500) {
546
+ const msg = res.body.message;
547
+ external_sweetalert2_default().fire("Server Error", msg, "error");
548
+ return;
549
+ }
544
550
 
545
- return (0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
546
- };
551
+ return (0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
552
+ };
547
553
 
548
- return (0,actions_namespaceObject.postRequest)((0,actions_namespaceObject.createAction)(CREATE_RESERVATION), (0,actions_namespaceObject.createAction)(CREATE_RESERVATION_SUCCESS), `${apiBaseUrl}/api/v1/summits/${summitId}/orders/reserve`, normalizedEntity, errorHandler // entity
549
- )(params)(dispatch).then(payload => {
550
- dispatch(stopWidgetLoading());
551
- payload.response.promo_code = promoCode || null;
554
+ return (0,actions_namespaceObject.postRequest)((0,actions_namespaceObject.createAction)(CREATE_RESERVATION), (0,actions_namespaceObject.createAction)(CREATE_RESERVATION_SUCCESS), `${apiBaseUrl}/api/v1/summits/${summitId}/orders/reserve`, normalizedEntity, errorHandler // entity
555
+ )(params)(dispatch).then(payload => {
556
+ dispatch(stopWidgetLoading());
557
+ payload.response.promo_code = promoCode || null;
552
558
 
553
- if (!payload.response.amount) {
554
- dispatch(payTicketWithProvider(provider));
555
- return payload;
556
- }
559
+ if (!payload.response.amount) {
560
+ dispatch(payTicketWithProvider(provider));
561
+ return payload;
562
+ }
557
563
 
558
- dispatch(changeStep(2));
559
- return payload;
560
- }).catch(e => {
564
+ dispatch(changeStep(2));
565
+ return payload;
566
+ }).catch(e => {
567
+ dispatch((0,actions_namespaceObject.createAction)(CREATE_RESERVATION_ERROR)(e));
568
+ dispatch(stopWidgetLoading());
569
+ return Promise.reject(e);
570
+ });
571
+ } catch (e) {
561
572
  dispatch((0,actions_namespaceObject.createAction)(CREATE_RESERVATION_ERROR)(e));
562
573
  dispatch(stopWidgetLoading());
563
- return e;
564
- });
574
+ return Promise.reject(e);
575
+ }
565
576
  };
566
577
  const removeReservedTicket = () => async (dispatch, getState, {
567
578
  apiBaseUrl,
568
579
  getAccessToken
569
580
  }) => {
570
- let {
571
- registrationLiteState: {
572
- settings: {
573
- summitId
574
- },
575
- reservation: {
576
- hash
581
+ try {
582
+ let {
583
+ registrationLiteState: {
584
+ settings: {
585
+ summitId
586
+ },
587
+ reservation: {
588
+ hash
589
+ }
577
590
  }
578
- }
579
- } = getState();
580
- const access_token = await getAccessToken();
581
- let params = {
582
- access_token,
583
- expand: 'tickets,tickets.owner'
584
- };
585
- dispatch(startWidgetLoading());
586
- return (0,actions_namespaceObject.deleteRequest)((0,actions_namespaceObject.createAction)(DELETE_RESERVATION), (0,actions_namespaceObject.createAction)(DELETE_RESERVATION_SUCCESS), `${apiBaseUrl}/api/v1/summits/${summitId}/orders/${hash}`, {}, actions_namespaceObject.authErrorHandler // entity
587
- )(params)(dispatch).then(payload => {
588
- dispatch(stopWidgetLoading());
589
- dispatch(changeStep(1));
590
- return payload;
591
- }).catch(e => {
591
+ } = getState();
592
+ const access_token = await getAccessToken();
593
+ let params = {
594
+ access_token,
595
+ expand: 'tickets,tickets.owner'
596
+ };
597
+ dispatch(startWidgetLoading());
598
+ return (0,actions_namespaceObject.deleteRequest)((0,actions_namespaceObject.createAction)(DELETE_RESERVATION), (0,actions_namespaceObject.createAction)(DELETE_RESERVATION_SUCCESS), `${apiBaseUrl}/api/v1/summits/${summitId}/orders/${hash}`, {}, actions_namespaceObject.authErrorHandler // entity
599
+ )(params)(dispatch).then(payload => {
600
+ dispatch(stopWidgetLoading());
601
+ dispatch(changeStep(1));
602
+ return payload;
603
+ }).catch(e => {
604
+ dispatch((0,actions_namespaceObject.createAction)(DELETE_RESERVATION_ERROR)(e));
605
+ dispatch(changeStep(1));
606
+ dispatch(stopWidgetLoading());
607
+ return Promise.reject(e);
608
+ });
609
+ } catch (e) {
592
610
  dispatch((0,actions_namespaceObject.createAction)(DELETE_RESERVATION_ERROR)(e));
593
611
  dispatch(changeStep(1));
594
612
  dispatch(stopWidgetLoading());
595
- return e;
596
- });
613
+ return Promise.reject(e);
614
+ }
597
615
  };
598
616
  const payTicketWithProvider = (provider, params = {}) => async (dispatch, getState, {
599
617
  apiBaseUrl,
600
618
  getAccessToken
601
619
  }) => {
602
- let {
603
- registrationLiteState: {
604
- settings: {
605
- summitId,
606
- userProfile
607
- },
608
- reservation
609
- }
610
- } = getState();
611
- const access_token = await getAccessToken();
612
- dispatch(startWidgetLoading());
613
- const currentProvider = PaymentProviderFactory.build(provider, {
614
- reservation,
615
- summitId,
616
- userProfile,
617
- access_token,
618
- apiBaseUrl,
619
- dispatch
620
- });
621
- return dispatch(currentProvider.payTicket(actions_objectSpread({}, params)));
620
+ try {
621
+ let {
622
+ registrationLiteState: {
623
+ settings: {
624
+ summitId,
625
+ userProfile
626
+ },
627
+ reservation
628
+ }
629
+ } = getState();
630
+ const access_token = await getAccessToken();
631
+ dispatch(startWidgetLoading());
632
+ const currentProvider = PaymentProviderFactory.build(provider, {
633
+ reservation,
634
+ summitId,
635
+ userProfile,
636
+ access_token,
637
+ apiBaseUrl,
638
+ dispatch
639
+ });
640
+ return dispatch(currentProvider.payTicket(actions_objectSpread({}, params)));
641
+ } catch (e) {
642
+ dispatch(stopWidgetLoading());
643
+ return Promise.reject(e);
644
+ }
622
645
  };
623
646
  const changeStep = step => (dispatch, getState) => {
624
647
  dispatch(startWidgetLoading());
@@ -724,9 +747,11 @@ const getMyInvitation = summitId => async (dispatch, getState, {
724
747
  dispatch(stopWidgetLoading());
725
748
  });
726
749
  } catch (e) {
727
- return Promise.reject();
750
+ return Promise.reject(e);
728
751
  }
729
752
  };
753
+ ;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/security/actions"
754
+ const security_actions_namespaceObject = require("openstack-uicore-foundation/lib/security/actions");
730
755
  ;// CONCATENATED MODULE: ./src/reducer.js
731
756
  function reducer_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
732
757
 
@@ -747,6 +772,7 @@ function reducer_defineProperty(obj, key, value) { if (key in obj) { Object.defi
747
772
  * limitations under the License.
748
773
  **/
749
774
 
775
+
750
776
  const DEFAULT_STATE = {
751
777
  reservation: null,
752
778
  checkout: null,
@@ -759,6 +785,9 @@ const DEFAULT_STATE = {
759
785
  error: false
760
786
  },
761
787
  ticketTypes: [],
788
+ // added this flag to really know if we requested or not the ticket types collection
789
+ // ( empty bc initial value or empty bc api empty response)
790
+ requestedTicketTypes: false,
762
791
  taxTypes: [],
763
792
  invitation: null,
764
793
  settings: {
@@ -776,6 +805,19 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
776
805
  } = action;
777
806
 
778
807
  switch (type) {
808
+ case CLEAR_WIDGET_STATE:
809
+ case security_actions_namespaceObject.LOGOUT_USER:
810
+ {
811
+ return DEFAULT_STATE;
812
+ }
813
+
814
+ case REQUESTED_TICKET_TYPES:
815
+ {
816
+ return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
817
+ requestedTicketTypes: false
818
+ });
819
+ }
820
+
779
821
  case START_WIDGET_LOADING:
780
822
  {
781
823
  return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
@@ -806,6 +848,9 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
806
848
  return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
807
849
  reservation: null,
808
850
  checkout: null,
851
+ ticketTypes: [],
852
+ requestedTicketTypes: false,
853
+ taxTypes: [],
809
854
  invitation: null,
810
855
  passwordless: reducer_objectSpread({}, DEFAULT_STATE.passwordless),
811
856
  settings: reducer_objectSpread(reducer_objectSpread({}, DEFAULT_STATE.settings), {}, {
@@ -826,7 +871,8 @@ const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
826
871
  case GET_TICKET_TYPES:
827
872
  {
828
873
  return reducer_objectSpread(reducer_objectSpread({}, state), {}, {
829
- ticketTypes: payload.response.data
874
+ ticketTypes: payload.response.data,
875
+ requestedTicketTypes: true
830
876
  });
831
877
  }
832
878
 
@@ -987,6 +1033,8 @@ var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_pr
987
1033
  const external_react_spring_namespaceObject = require("react-spring");
988
1034
  ;// CONCATENATED MODULE: external "react-use"
989
1035
  const external_react_use_namespaceObject = require("react-use");
1036
+ ;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/security/constants"
1037
+ const constants_namespaceObject = require("openstack-uicore-foundation/lib/security/constants");
990
1038
  ;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/components/ajaxloader"
991
1039
  const ajaxloader_namespaceObject = require("openstack-uicore-foundation/lib/components/ajaxloader");
992
1040
  var ajaxloader_default = /*#__PURE__*/__webpack_require__.n(ajaxloader_namespaceObject);
@@ -2653,7 +2701,7 @@ const TicketTaxesError = ({
2653
2701
 
2654
2702
  /* harmony default export */ const ticket_taxes_error = (TicketTaxesError);
2655
2703
  ;// CONCATENATED MODULE: ./src/components/registration-lite.js
2656
- const registration_lite_excluded = ["loadSession", "setMarketingSettings", "changeStep", "removeReservedTicket", "reserveTicket", "payTicketWithProvider", "onPurchaseComplete", "getTicketTypesAndTaxes", "getLoginCode", "passwordlessLogin", "goToLogin", "loginOptions", "allowsNativeAuth", "allowsOtpAuth", "reservation", "checkout", "ticketTypes", "taxTypes", "step", "passwordlessCodeSent", "passwordlessEmail", "passwordlessCode", "getPasswordlessCode", "passwordlessCodeError", "loginWithCode", "goToExtraQuestions", "goToEvent", "goToRegistration", "profileData", "summitData", "supportEmail", "ticketOwned", "ownedTickets", "widgetLoading", "loading", "inPersonDisclaimer", "userProfile", "handleCompanyError", "stripeOptions", "invitation", "loginInitialEmailInputValue", "getMyInvitation", "showMultipleTicketTexts", "noAllowedTicketsMessage", "ticketTaxesErrorMessage"];
2704
+ const registration_lite_excluded = ["loadSession", "setMarketingSettings", "changeStep", "removeReservedTicket", "reserveTicket", "payTicketWithProvider", "onPurchaseComplete", "getTicketTypesAndTaxes", "getLoginCode", "passwordlessLogin", "goToLogin", "loginOptions", "allowsNativeAuth", "allowsOtpAuth", "reservation", "checkout", "ticketTypes", "taxTypes", "step", "passwordlessCodeSent", "passwordlessEmail", "passwordlessCode", "getPasswordlessCode", "passwordlessCodeError", "loginWithCode", "goToExtraQuestions", "goToEvent", "goToRegistration", "profileData", "summitData", "supportEmail", "ticketOwned", "ownedTickets", "widgetLoading", "loading", "inPersonDisclaimer", "userProfile", "handleCompanyError", "stripeOptions", "invitation", "loginInitialEmailInputValue", "getMyInvitation", "showMultipleTicketTexts", "noAllowedTicketsMessage", "ticketTaxesErrorMessage", "authErrorCallback", "clearWidgetState", "requestedTicketTypes"];
2657
2705
 
2658
2706
  function registration_lite_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2659
2707
 
@@ -2696,6 +2744,7 @@ function registration_lite_objectWithoutPropertiesLoose(source, excluded) { if (
2696
2744
 
2697
2745
 
2698
2746
 
2747
+
2699
2748
 
2700
2749
 
2701
2750
  const RegistrationLite = _ref => {
@@ -2746,7 +2795,10 @@ const RegistrationLite = _ref => {
2746
2795
  getMyInvitation,
2747
2796
  showMultipleTicketTexts,
2748
2797
  noAllowedTicketsMessage,
2749
- ticketTaxesErrorMessage
2798
+ ticketTaxesErrorMessage,
2799
+ authErrorCallback,
2800
+ clearWidgetState,
2801
+ requestedTicketTypes
2750
2802
  } = _ref,
2751
2803
  rest = registration_lite_objectWithoutProperties(_ref, registration_lite_excluded);
2752
2804
 
@@ -2791,12 +2843,12 @@ const RegistrationLite = _ref => {
2791
2843
  if (summitData && profileData) {
2792
2844
  handleGetTicketTypesAndTaxes(summitData.id);
2793
2845
  }
2794
- }, []);
2846
+ }, [summitData, profileData]);
2795
2847
  (0,external_react_namespaceObject.useEffect)(() => {
2796
2848
  if (summitData && profileData) {
2797
2849
  getMyInvitation(summitData.id).catch(e => console.log(e));
2798
2850
  }
2799
- }, []);
2851
+ }, [summitData, profileData]);
2800
2852
  (0,external_react_namespaceObject.useEffect)(() => {
2801
2853
  if (step === 1 && formValues !== null && formValues !== void 0 && formValues.ticketType && formValues !== null && formValues !== void 0 && formValues.personalInformation) {
2802
2854
  reserveTicket({
@@ -2806,6 +2858,16 @@ const RegistrationLite = _ref => {
2806
2858
  ticketQuantity: formValues === null || formValues === void 0 ? void 0 : formValues.ticketQuantity
2807
2859
  }, {
2808
2860
  onError: (err, res) => setFormErrors(res.body.errors)
2861
+ }).catch(error => {
2862
+ let {
2863
+ message
2864
+ } = error;
2865
+
2866
+ if (message && (message.includes(constants_namespaceObject.AUTH_ERROR_MISSING_AUTH_INFO) || message.includes(constants_namespaceObject.AUTH_ERROR_MISSING_REFRESH_TOKEN) || message.includes(constants_namespaceObject.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR))) {
2867
+ // we dont have an access token, init log out process
2868
+ clearWidgetState();
2869
+ return authErrorCallback(error);
2870
+ }
2809
2871
  });
2810
2872
  }
2811
2873
 
@@ -2839,6 +2901,16 @@ const RegistrationLite = _ref => {
2839
2901
  const handleGetTicketTypesAndTaxes = summitId => {
2840
2902
  setTicketTaxesError(false);
2841
2903
  getTicketTypesAndTaxes(summitId).then().catch(error => {
2904
+ let {
2905
+ message
2906
+ } = error;
2907
+
2908
+ if (message && (message.includes(constants_namespaceObject.AUTH_ERROR_MISSING_AUTH_INFO) || message.includes(constants_namespaceObject.AUTH_ERROR_MISSING_REFRESH_TOKEN) || message.includes(constants_namespaceObject.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR))) {
2909
+ // we dont have an access token, init log out process
2910
+ clearWidgetState();
2911
+ return authErrorCallback(error);
2912
+ }
2913
+
2842
2914
  setTicketTaxesError(true);
2843
2915
  });
2844
2916
  };
@@ -2868,7 +2940,7 @@ const RegistrationLite = _ref => {
2868
2940
  })), ticketTaxesError && profileData && /*#__PURE__*/external_react_default().createElement(ticket_taxes_error, {
2869
2941
  ticketTaxesErrorMessage: ticketTaxesErrorMessage,
2870
2942
  retryTicketTaxes: () => handleGetTicketTypesAndTaxes(summitData === null || summitData === void 0 ? void 0 : summitData.id)
2871
- }), !ticketTaxesError && profileData && ticketTypes.length === 0 && !loading && /*#__PURE__*/external_react_default().createElement(no_allowed_tickets, {
2943
+ }), !ticketTaxesError && profileData && ticketTypes.length === 0 && requestedTicketTypes && /*#__PURE__*/external_react_default().createElement(no_allowed_tickets, {
2872
2944
  noAllowedTicketsMessage: noAllowedTicketsMessage
2873
2945
  }), !ticketTaxesError && /*#__PURE__*/external_react_default().createElement("div", {
2874
2946
  className: general_module.stepsWrapper
@@ -2951,6 +3023,7 @@ const registration_lite_mapStateToProps = ({
2951
3023
  userProfile: registrationLiteState.settings.userProfile,
2952
3024
  checkout: registrationLiteState.checkout,
2953
3025
  ticketTypes: registrationLiteState.ticketTypes,
3026
+ requestedTicketTypes: registrationLiteState.requestedTicketTypes,
2954
3027
  taxTypes: registrationLiteState.taxTypes,
2955
3028
  step: registrationLiteState.step,
2956
3029
  passwordlessEmail: registrationLiteState.passwordless.email,
@@ -2963,11 +3036,15 @@ RegistrationLite.defaultProps = {
2963
3036
  loginInitialEmailInputValue: '',
2964
3037
  showMultipleTicketTexts: true,
2965
3038
  noAllowedTicketsMessage: '<span>You already have purchased all available tickets for this event and/or there are no tickets available for you to purchase.</span><br/><span><a href="/a/my-tickets">Visit the my orders / my tickets page</a> to review your existing tickets.</span>',
2966
- ticketTaxesErrorMessage: '<span>There was an error getting the information for the tickets. Please try it again.</span>'
3039
+ ticketTaxesErrorMessage: '<span>There was an error getting the information for the tickets. Please try it again.</span>',
3040
+ authErrorCallback: error => {
3041
+ console.log(error);
3042
+ }
2967
3043
  };
2968
3044
  RegistrationLite.propTypes = {
2969
3045
  loginInitialEmailInputValue: (external_prop_types_default()).string,
2970
- showMultipleTicketTexts: (external_prop_types_default()).bool
3046
+ showMultipleTicketTexts: (external_prop_types_default()).bool,
3047
+ authErrorCallback: (external_prop_types_default()).func
2971
3048
  };
2972
3049
  /* harmony default export */ const registration_lite = ((0,external_react_redux_namespaceObject.connect)(registration_lite_mapStateToProps, {
2973
3050
  loadSession: loadSession,
@@ -2979,7 +3056,8 @@ RegistrationLite.propTypes = {
2979
3056
  getLoginCode: getLoginCode,
2980
3057
  passwordlessLogin: passwordlessLogin,
2981
3058
  goToLogin: goToLogin,
2982
- getMyInvitation: getMyInvitation
3059
+ getMyInvitation: getMyInvitation,
3060
+ clearWidgetState: clearWidgetState
2983
3061
  })(RegistrationLite));
2984
3062
  ;// CONCATENATED MODULE: ./src/summit-registration-lite.js
2985
3063
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "summit-registration-lite",
3
- "version": "3.0.15",
3
+ "version": "3.0.18",
4
4
  "description": "Summit Registration Lite",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -60,7 +60,7 @@
60
60
  "moment": "^2.22.2",
61
61
  "moment-timezone": "^0.5.21",
62
62
  "node-sass": "^7.0.1",
63
- "openstack-uicore-foundation": "^4.0.43",
63
+ "openstack-uicore-foundation": "^4.0.49",
64
64
  "optimize-css-assets-webpack-plugin": "^6.0.1",
65
65
  "path": "^0.12.7",
66
66
  "react": "^16.8.4",
@@ -109,7 +109,7 @@
109
109
  "lodash": "^4.17.14",
110
110
  "moment": "^2.22.2",
111
111
  "moment-timezone": "^0.5.21",
112
- "openstack-uicore-foundation": "^4.0.35",
112
+ "openstack-uicore-foundation": "^4.0.49",
113
113
  "react": "^16.8.4",
114
114
  "react-bootstrap": "^0.31.5",
115
115
  "react-datetime": "^2.16.2",