@opexa/portal-sdk 0.59.79 → 0.59.80

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.
package/dist/index.cjs CHANGED
@@ -4485,6 +4485,13 @@ var ERROR_MAP = {
4485
4485
  };
4486
4486
 
4487
4487
  // src/services/auth.service.ts
4488
+ function isWebPlatform() {
4489
+ try {
4490
+ return core.Capacitor.getPlatform() === "web";
4491
+ } catch {
4492
+ return false;
4493
+ }
4494
+ }
4488
4495
  var AuthService = class {
4489
4496
  url;
4490
4497
  options;
@@ -4538,7 +4545,9 @@ var AuthService = class {
4538
4545
  headers.set("test-pass", input.testPass);
4539
4546
  }
4540
4547
  try {
4541
- const res = await fetch(`${this.url}${version !== 1 ? `/v${version}/sessions` : "/sessions"}`, {
4548
+ const isWeb = isWebPlatform();
4549
+ const queryParam = isWeb && version === 4 ? "?type=web" : "";
4550
+ const res = await fetch(`${this.url}${version !== 1 ? `/v${version}/sessions` : "/sessions"}${queryParam}`, {
4542
4551
  method: "POST",
4543
4552
  headers,
4544
4553
  body: JSON.stringify(input),
@@ -4636,8 +4645,10 @@ var AuthService = class {
4636
4645
  }
4637
4646
  }
4638
4647
  try {
4648
+ const isWeb = isWebPlatform();
4649
+ const queryParam = isWeb && version === 4 ? "?type=web" : "";
4639
4650
  const res = await fetch(
4640
- `${this.url}${version !== 1 ? `/v${version}/session/refresh` : "/session:refresh"}`,
4651
+ `${this.url}${version !== 1 ? `/v${version}/session/refresh` : "/session:refresh"}${queryParam}`,
4641
4652
  {
4642
4653
  method: "POST",
4643
4654
  headers,