@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.
@@ -4450,7 +4450,7 @@ var AuthService = class {
4450
4450
  }
4451
4451
  async createSession(input, version = 1) {
4452
4452
  const headers = new Headers(this.headers);
4453
- if (version === 3) {
4453
+ if (version === 3 || version === 4) {
4454
4454
  const fingerprint = await getFingerPrint();
4455
4455
  if (fingerprint) {
4456
4456
  headers.append("Fingerprint", fingerprint);
@@ -4579,9 +4579,15 @@ var AuthService = class {
4579
4579
  if (version !== 4) {
4580
4580
  headers.append("Authorization", `Bearer ${refreshToken}`);
4581
4581
  }
4582
+ if (version === 3 || version === 4) {
4583
+ const fingerprint = await getFingerPrint();
4584
+ if (fingerprint) {
4585
+ headers.append("Fingerprint", fingerprint);
4586
+ }
4587
+ }
4582
4588
  try {
4583
4589
  const res = await fetch(
4584
- `${this.url}${version === 4 ? "/v4/session/refresh" : "/session:refresh"}`,
4590
+ `${this.url}${version !== 1 ? `/v${version}/session/refresh` : "/session:refresh"}`,
4585
4591
  {
4586
4592
  method: "POST",
4587
4593
  headers,
@@ -4624,14 +4630,20 @@ var AuthService = class {
4624
4630
  };
4625
4631
  }
4626
4632
  }
4627
- async destroySession(accessToken) {
4633
+ async destroySession(accessToken, version = 1) {
4628
4634
  const headers = new Headers(this.headers);
4629
- headers.append("Authorization", `Bearer ${accessToken}`);
4635
+ if (version !== 4) {
4636
+ headers.append("Authorization", `Bearer ${accessToken}`);
4637
+ }
4630
4638
  try {
4631
- const res = await fetch(`${this.url}/session`, {
4632
- method: "DELETE",
4633
- headers
4634
- });
4639
+ const res = await fetch(
4640
+ `${this.url}${version !== 1 ? `/v${version}/session` : "/session"}`,
4641
+ {
4642
+ method: "DELETE",
4643
+ headers,
4644
+ ...version === 4 && { credentials: "include" }
4645
+ }
4646
+ );
4635
4647
  return res.ok ? { ok: true } : { ok: false, error: statusCodeToOperationError(res.status) };
4636
4648
  } catch {
4637
4649
  return { ok: false, error: statusCodeToOperationError(500) };
@@ -6501,5 +6513,5 @@ var ExtensionService = class {
6501
6513
  };
6502
6514
 
6503
6515
  export { AccountService, AuthService, CmsPortalService, ExtensionService, FileService, GameService, PortalService, ReportService, TriggerService, WalletService, getFingerPrint };
6504
- //# sourceMappingURL=chunk-BDZPLMTL.js.map
6505
- //# sourceMappingURL=chunk-BDZPLMTL.js.map
6516
+ //# sourceMappingURL=chunk-3WS4U4B7.js.map
6517
+ //# sourceMappingURL=chunk-3WS4U4B7.js.map