From 0e4a0fadd0042bb5e9460045ec29849d577e4015 Mon Sep 17 00:00:00 2001 From: Daniel Kluge Date: Sat, 7 May 2022 22:18:57 +0200 Subject: [PATCH] Add empty secrets.json --- secrets.template.json | 4 ++++ src/getToken.js | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 secrets.template.json 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());