nolimit-x 1.0.56 → 1.0.57
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/package.json +1 -1
- package/src/license.js +13 -10
package/package.json
CHANGED
package/src/license.js
CHANGED
|
@@ -67,19 +67,22 @@ function checkLicense(workdir) {
|
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
// 2. Decode the key
|
|
70
|
+
// 2. Decode the key
|
|
71
|
+
// New format: base64url(payload).base64url(signature) — dot is in the raw key
|
|
72
|
+
// Old format: base64(base64(payload).base64(signature)) — no dot in raw key
|
|
71
73
|
let payloadB64, signatureB64;
|
|
72
74
|
try {
|
|
73
|
-
// Try base64url first (new shorter format), then standard base64 (legacy)
|
|
74
75
|
let inner;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
if (rawKey.includes('.')) {
|
|
77
|
+
// New direct format — the key itself is payload.signature
|
|
78
|
+
inner = rawKey;
|
|
79
|
+
} else {
|
|
80
|
+
// Old wrapped format — decode outer base64 first
|
|
81
|
+
try {
|
|
82
|
+
inner = Buffer.from(rawKey, 'base64url').toString('utf8');
|
|
83
|
+
} catch {
|
|
84
|
+
inner = Buffer.from(rawKey, 'base64').toString('utf8');
|
|
85
|
+
}
|
|
83
86
|
}
|
|
84
87
|
const dotIdx = inner.indexOf('.');
|
|
85
88
|
if (dotIdx === -1) {
|