From e1727476e0c66bcd36c8d7dabf6ebf4c9784408e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20MIELCAREK?= <94568134+felixmielcarek@users.noreply.github.com> Date: Wed, 22 May 2024 14:07:14 +0200 Subject: [PATCH] Update app.js --- callback-server/app.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/callback-server/app.js b/callback-server/app.js index a9a17cf..b959d81 100644 --- a/callback-server/app.js +++ b/callback-server/app.js @@ -11,6 +11,13 @@ const clientSecret = process.env.CLIENT_SECRET; const redirectUri = 'https://felixmielcarek.github.io/callback/'; //#endregion +//#region LOGS +function stepBeggining(step) { + const sptor = "=".repeat(5); + console.log(`\n${sptor} ${step} ${sptor}`); +} +//#endregion + //#region APP INIT const app = express() app.listen(port, () => { console.log(`Big brother is listening on port ${port}`) }) @@ -18,7 +25,8 @@ app.listen(port, () => { console.log(`Big brother is listening on port ${port}`) //#region ACCESS TOKEN app.get('/settings/deactivate', async (req,res) => { - //console.log(" + stepBeggining("Setting: deactivation"); + const code = req.query.code; const authOptions = { url: 'https://accounts.spotify.com/api/token', method: 'post', json: true, @@ -65,6 +73,8 @@ app.get('/settings/deactivate', async (req,res) => { }) app.get('/', async (req, res) => { + stepBeggining("Activation"); + const code = req.query.code; const authOptions = { url: 'https://accounts.spotify.com/api/token', method: 'post', json: true,