@openfin/cloud-interop-core-api 0.0.1-alpha.9a0045a → 0.0.1-alpha.9a2ca93
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/index.cjs +3 -1
- package/index.mjs +3 -1
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
var buffer = require('buffer');
|
|
4
4
|
var mqtt = require('mqtt');
|
|
5
5
|
|
|
6
|
+
var l=t=>{let e=t.replaceAll("-","+").replaceAll("_","/");return e.padEnd(e.length+(4-e.length%4)%4,"=")};
|
|
7
|
+
|
|
6
8
|
class CloudInteropAPIError extends Error {
|
|
7
9
|
code;
|
|
8
10
|
constructor(message = 'An unexpected error has occurred', code = 'UNEXPECTED_ERROR', cause) {
|
|
@@ -684,7 +686,7 @@ class CloudInteropAPI {
|
|
|
684
686
|
}
|
|
685
687
|
const payload = parts[1];
|
|
686
688
|
// Decode base64url encoded payload
|
|
687
|
-
const decodedBytes = buffer.Buffer.from(payload, '
|
|
689
|
+
const decodedBytes = buffer.Buffer.from(l(payload), 'base64');
|
|
688
690
|
const payloadJson = decodedBytes.toString('utf8');
|
|
689
691
|
// Parse JSON to get the exp claim
|
|
690
692
|
const claims = JSON.parse(payloadJson);
|
package/index.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Buffer } from 'buffer';
|
|
2
2
|
import mqtt from 'mqtt';
|
|
3
3
|
|
|
4
|
+
var l=t=>{let e=t.replaceAll("-","+").replaceAll("_","/");return e.padEnd(e.length+(4-e.length%4)%4,"=")};
|
|
5
|
+
|
|
4
6
|
class CloudInteropAPIError extends Error {
|
|
5
7
|
code;
|
|
6
8
|
constructor(message = 'An unexpected error has occurred', code = 'UNEXPECTED_ERROR', cause) {
|
|
@@ -682,7 +684,7 @@ class CloudInteropAPI {
|
|
|
682
684
|
}
|
|
683
685
|
const payload = parts[1];
|
|
684
686
|
// Decode base64url encoded payload
|
|
685
|
-
const decodedBytes = Buffer.from(payload, '
|
|
687
|
+
const decodedBytes = Buffer.from(l(payload), 'base64');
|
|
686
688
|
const payloadJson = decodedBytes.toString('utf8');
|
|
687
689
|
// Parse JSON to get the exp claim
|
|
688
690
|
const claims = JSON.parse(payloadJson);
|