acsi-core 0.1.59 → 0.1.60

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.
@@ -365,7 +365,7 @@ var BlockLogin = function BlockLogin(_ref) {
365
365
  className: styleGlobal["box-text"]
366
366
  }, "Your code will expire: ", React.createElement("span", null, formatTime()))), React.createElement("button", {
367
367
  onClick: function onClick() {
368
- return loginWithEmailCode();
368
+ return loginWithEmailCode(role);
369
369
  },
370
370
  className: "" + styleGlobal["box-button-email"]
371
371
  }, React.createElement("img", {
@@ -384,7 +384,7 @@ var BlockLogin = function BlockLogin(_ref) {
384
384
  }
385
385
  })), React.createElement("button", {
386
386
  onClick: function onClick() {
387
- !!email && loginWithEmail();
387
+ !!email && loginWithEmail(role);
388
388
  },
389
389
  className: "" + styleGlobal["box-button-email"]
390
390
  }, React.createElement("img", {
@@ -547,14 +547,18 @@ var useLogin = function useLogin(onNavigate, trackEvent) {
547
547
  var _useState6 = useState(minutes * 60),
548
548
  timeLeft = _useState6[0],
549
549
  setTimeLeft = _useState6[1];
550
- var loginWithEmail = function loginWithEmail() {
550
+ var loginWithEmail = function loginWithEmail(role) {
551
551
  try {
552
552
  var _temp2 = function _temp2() {
553
553
  dispatch(setLoading(false));
554
554
  };
555
555
  dispatch(setLoading(true));
556
556
  var _temp = _catch(function () {
557
- return Promise.resolve(apiSendEmailCode(email)).then(function (res) {
557
+ var body = {
558
+ email: email,
559
+ role: role
560
+ };
561
+ return Promise.resolve(apiSendEmailCode(body)).then(function (res) {
558
562
  var data = res.data;
559
563
  if (data.status == 1) {
560
564
  if (data.data.token != null) {
@@ -585,7 +589,7 @@ var useLogin = function useLogin(onNavigate, trackEvent) {
585
589
  return Promise.reject(e);
586
590
  }
587
591
  };
588
- var loginWithEmailCode = function loginWithEmailCode() {
592
+ var loginWithEmailCode = function loginWithEmailCode(role) {
589
593
  try {
590
594
  var _temp4 = function _temp4() {
591
595
  dispatch(setLoading(false));
@@ -594,7 +598,8 @@ var useLogin = function useLogin(onNavigate, trackEvent) {
594
598
  var _temp3 = _catch(function () {
595
599
  return Promise.resolve(apiCheckEmailCode({
596
600
  email: email,
597
- code: code
601
+ code: code,
602
+ role: role
598
603
  })).then(function (res) {
599
604
  var data = res.data;
600
605
  if (data.status == 1) {