@opexa/portal-sdk 0.59.76 → 0.59.77

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.
@@ -4479,7 +4479,7 @@ var AuthService = class {
4479
4479
  }
4480
4480
  async createSession(input, version = 1) {
4481
4481
  const headers = new Headers(this.headers);
4482
- if (version === 3) {
4482
+ if (version === 3 || version === 4) {
4483
4483
  const fingerprint = await getFingerPrint();
4484
4484
  if (fingerprint) {
4485
4485
  headers.append("Fingerprint", fingerprint);
@@ -4608,9 +4608,15 @@ var AuthService = class {
4608
4608
  if (version !== 4) {
4609
4609
  headers.append("Authorization", `Bearer ${refreshToken}`);
4610
4610
  }
4611
+ if (version === 3 || version === 4) {
4612
+ const fingerprint = await getFingerPrint();
4613
+ if (fingerprint) {
4614
+ headers.append("Fingerprint", fingerprint);
4615
+ }
4616
+ }
4611
4617
  try {
4612
4618
  const res = await fetch(
4613
- `${this.url}${version === 4 ? "/v4/session/refresh" : "/session:refresh"}`,
4619
+ `${this.url}${version !== 1 ? `/v${version}/session/refresh` : "/session:refresh"}`,
4614
4620
  {
4615
4621
  method: "POST",
4616
4622
  headers,
@@ -4653,14 +4659,20 @@ var AuthService = class {
4653
4659
  };
4654
4660
  }
4655
4661
  }
4656
- async destroySession(accessToken) {
4662
+ async destroySession(accessToken, version = 1) {
4657
4663
  const headers = new Headers(this.headers);
4658
- headers.append("Authorization", `Bearer ${accessToken}`);
4664
+ if (version !== 4) {
4665
+ headers.append("Authorization", `Bearer ${accessToken}`);
4666
+ }
4659
4667
  try {
4660
- const res = await fetch(`${this.url}/session`, {
4661
- method: "DELETE",
4662
- headers
4663
- });
4668
+ const res = await fetch(
4669
+ `${this.url}${version !== 1 ? `/v${version}/session` : "/session"}`,
4670
+ {
4671
+ method: "DELETE",
4672
+ headers,
4673
+ ...version === 4 && { credentials: "include" }
4674
+ }
4675
+ );
4664
4676
  return res.ok ? { ok: true } : { ok: false, error: statusCodeToOperationError(res.status) };
4665
4677
  } catch {
4666
4678
  return { ok: false, error: statusCodeToOperationError(500) };