libroadcast-cli 1.11.0 → 1.11.1
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.
|
@@ -107,11 +107,15 @@ const checkTokenScopes = async (modRequired) => {
|
|
|
107
107
|
"Content-Type": "text/plain",
|
|
108
108
|
},
|
|
109
109
|
body: exports.LICHESS_TOKEN,
|
|
110
|
+
bodySerializer: (body) => body,
|
|
110
111
|
})
|
|
111
112
|
.then((response) => response.data)
|
|
112
|
-
.then((data) =>
|
|
113
|
+
.then((data) => {
|
|
114
|
+
let scopes = data?.[exports.LICHESS_TOKEN]?.scopes;
|
|
115
|
+
return scopes ? scopes.split(",") : [];
|
|
116
|
+
})
|
|
113
117
|
.then((scopes) => {
|
|
114
|
-
const missingScopes = requiredScopes.filter((scope) => !scopes
|
|
118
|
+
const missingScopes = requiredScopes.filter((scope) => !scopes.includes(scope));
|
|
115
119
|
if (missingScopes.length > 0) {
|
|
116
120
|
console.error(colors_1.default.red(`Error: Missing required token scopes: ${missingScopes.join(", ")}`));
|
|
117
121
|
process.exit(1);
|