diff --git a/secrets.template.json b/secrets.template.json new file mode 100644 index 0000000..5d58928 --- /dev/null +++ b/secrets.template.json @@ -0,0 +1,4 @@ +{ + "clientId": "", + "clientSecret": "" +} \ No newline at end of file diff --git a/src/getToken.js b/src/getToken.js index 4bc73ab..d33a38d 100644 --- a/src/getToken.js +++ b/src/getToken.js @@ -5,6 +5,11 @@ import fetch from "node-fetch"; import { writeFileSync } from "fs"; import { secretsFile, secrets } from "./common.js"; +if (!secrets.clientId || !secrets.clientSecret) { + console.error("No client credentials token found. Please run 'npm run token' first."); + process.exit(1); +} + const app = express() app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json());