@opexa/portal-sdk 0.59.77 → 0.59.78

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.
@@ -4523,26 +4523,26 @@ var AuthService = class {
4523
4523
  body: JSON.stringify(input),
4524
4524
  ...version === 4 && { credentials: "include" }
4525
4525
  });
4526
- const data = await res.json();
4526
+ const body = await res.json();
4527
4527
  if (res.ok) {
4528
4528
  return {
4529
4529
  ok: true,
4530
- data
4530
+ data: version !== 1 ? body.data ?? body : body
4531
4531
  };
4532
4532
  }
4533
- if (data.code === "ACCOUNT_BLACKLISTED") {
4533
+ if (body.code === "ACCOUNT_BLACKLISTED") {
4534
4534
  return {
4535
4535
  ok: false,
4536
4536
  error: createOperationError("AccountBlacklistedError")
4537
4537
  };
4538
4538
  }
4539
- if (data.code === "MEMBER_ACCOUNT_SUSPENDED") {
4539
+ if (body.code === "MEMBER_ACCOUNT_SUSPENDED") {
4540
4540
  return {
4541
4541
  ok: false,
4542
4542
  error: createOperationError("AccountSuspendedError")
4543
4543
  };
4544
4544
  }
4545
- if (data.code === "INVALID_RECAPTCHA_RESPONSE") {
4545
+ if (body.code === "INVALID_RECAPTCHA_RESPONSE") {
4546
4546
  return {
4547
4547
  ok: false,
4548
4548
  error: createOperationError("InvalidReCAPTCHAResponseError")
@@ -4623,20 +4623,20 @@ var AuthService = class {
4623
4623
  ...version === 4 && { credentials: "include" }
4624
4624
  }
4625
4625
  );
4626
- const data = await res.json();
4626
+ const body = await res.json();
4627
4627
  if (res.ok) {
4628
4628
  return {
4629
4629
  ok: true,
4630
- data
4630
+ data: version !== 1 ? body.data ?? body : body
4631
4631
  };
4632
4632
  }
4633
- if (data.code === "ACCOUNT_BLACKLISTED") {
4633
+ if (body.code === "ACCOUNT_BLACKLISTED") {
4634
4634
  return {
4635
4635
  ok: false,
4636
4636
  error: createOperationError("AccountBlacklistedError")
4637
4637
  };
4638
4638
  }
4639
- if (data.code === "MEMBER_ACCOUNT_SUSPENDED") {
4639
+ if (body.code === "MEMBER_ACCOUNT_SUSPENDED") {
4640
4640
  return {
4641
4641
  ok: false,
4642
4642
  error: createOperationError("AccountSuspendedError")
@@ -4661,9 +4661,7 @@ var AuthService = class {
4661
4661
  }
4662
4662
  async destroySession(accessToken, version = 1) {
4663
4663
  const headers = new Headers(this.headers);
4664
- if (version !== 4) {
4665
- headers.append("Authorization", `Bearer ${accessToken}`);
4666
- }
4664
+ headers.append("Authorization", `Bearer ${accessToken}`);
4667
4665
  try {
4668
4666
  const res = await fetch(
4669
4667
  `${this.url}${version !== 1 ? `/v${version}/session` : "/session"}`,