@opexa/portal-sdk 0.9.0 → 0.10.0
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 +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2437,10 +2437,10 @@ var AuthService = class {
|
|
|
2437
2437
|
headers.set("Authorization", `Token ${input.token}`);
|
|
2438
2438
|
}
|
|
2439
2439
|
if (input.type === "CABINET") {
|
|
2440
|
-
headers.set("Authorization", `
|
|
2440
|
+
headers.set("Authorization", `Opexa-Cabinet-Token ${input.token}`);
|
|
2441
2441
|
}
|
|
2442
|
-
if (input.type === "
|
|
2443
|
-
headers.set("Authorization", `
|
|
2442
|
+
if (input.type === "SINGLE_USE_TOKEN") {
|
|
2443
|
+
headers.set("Authorization", `Single-Use-Token ${input.token}`);
|
|
2444
2444
|
}
|
|
2445
2445
|
if (input.reCAPTCHAResponse) {
|
|
2446
2446
|
headers.set("google-recaptcha-response", input.reCAPTCHAResponse);
|
|
@@ -2642,7 +2642,7 @@ var AuthService = class {
|
|
|
2642
2642
|
};
|
|
2643
2643
|
}
|
|
2644
2644
|
}
|
|
2645
|
-
async
|
|
2645
|
+
async createSingleUseToken(accessToken) {
|
|
2646
2646
|
const headers = new Headers(this.headers);
|
|
2647
2647
|
headers.append("Authorization", `Bearer ${accessToken}`);
|
|
2648
2648
|
try {
|
|
@@ -5508,9 +5508,9 @@ var Sdk = class {
|
|
|
5508
5508
|
});
|
|
5509
5509
|
return res.ok ? { ok: true } : res;
|
|
5510
5510
|
}
|
|
5511
|
-
case "
|
|
5511
|
+
case "SINGLE_USE_TOKEN": {
|
|
5512
5512
|
const res = await this.sessionManager.create({
|
|
5513
|
-
type: "
|
|
5513
|
+
type: "SINGLE_USE_TOKEN",
|
|
5514
5514
|
token: input.token
|
|
5515
5515
|
});
|
|
5516
5516
|
return res.ok ? { ok: true } : res;
|
|
@@ -5577,7 +5577,7 @@ var Sdk = class {
|
|
|
5577
5577
|
async validateMayaSession() {
|
|
5578
5578
|
return await this.walletService.validateMayaSession();
|
|
5579
5579
|
}
|
|
5580
|
-
async
|
|
5580
|
+
async createSingleUseToken() {
|
|
5581
5581
|
const res0 = await this.sessionManager.get();
|
|
5582
5582
|
if (!res0.ok || !res0.data) {
|
|
5583
5583
|
return {
|
|
@@ -5588,7 +5588,7 @@ var Sdk = class {
|
|
|
5588
5588
|
}
|
|
5589
5589
|
};
|
|
5590
5590
|
}
|
|
5591
|
-
const res1 = await this.authService.
|
|
5591
|
+
const res1 = await this.authService.createSingleUseToken(res0.data.accessToken);
|
|
5592
5592
|
if (!res1.ok) return res1;
|
|
5593
5593
|
return { ok: true, data: res1.data.token };
|
|
5594
5594
|
}
|