From 19f51d3a5a1e0ae3a07f1d8d30720fafbdf605d8 Mon Sep 17 00:00:00 2001 From: Dessa Simpson Date: Sun, 5 Jul 2020 20:13:07 -0700 Subject: [PATCH] Fix handling of twitch auth flow rejection --- src/app.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index e998ede..b579022 100644 --- a/src/app.ts +++ b/src/app.ts @@ -110,7 +110,10 @@ app.post("/api/deleteRequest", async (request, response) => { // Twitch callback app.get("/callback", async (request, response) => { - if (request.query.error) response.redirect(307, '/'); + if (request.query.error) { + response.redirect(307, '/'); + return; + } var authcode = request.query.code as string; var tokenResponse = await fetch("https://id.twitch.tv/oauth2/token", { method: "POST", body: new URLSearchParams({ client_id: config.twitchClientId,