repl.it-api
Advanced tools
Comparing version 1.2.2 to 1.2.3
13
lib.js
@@ -33,3 +33,3 @@ const { CookieJar, Cookie } = require('tough-cookie') | ||
this.got.token = await this.fetch(`https://repl.it/data/repls/${id}/gen_repl_token`, { | ||
const potentialToken = await this.fetch(`https://repl.it/data/repls/${id}/gen_repl_token`, { | ||
method: 'POST', | ||
@@ -41,3 +41,12 @@ body: JSON.stringify({ | ||
headers | ||
}).then(parseJson, url) | ||
}).then(parseJson) | ||
if (potentialToken.message) { | ||
if (potentialToken.name) { | ||
throw new Error(`${potentialToken.name}: ${potentialToken.message}`) | ||
} else { | ||
throw new Error(potentialToken.message) | ||
} | ||
} else { | ||
this.got.token = potentialToken | ||
} | ||
} | ||
@@ -44,0 +53,0 @@ |
{ | ||
"name": "repl.it-api", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "A Node.js client for creating projects and executing code on Repl.it.", | ||
@@ -5,0 +5,0 @@ "main": "lib.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15845
216