Fix handling of twitch auth flow rejection
parent
12d4ffad2b
commit
19f51d3a5a
|
@ -110,7 +110,10 @@ app.post("/api/deleteRequest", async (request, response) => {
|
||||||
|
|
||||||
// Twitch callback
|
// Twitch callback
|
||||||
app.get("/callback", async (request, response) => {
|
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 authcode = request.query.code as string;
|
||||||
var tokenResponse = await fetch("https://id.twitch.tv/oauth2/token", { method: "POST", body: new URLSearchParams({
|
var tokenResponse = await fetch("https://id.twitch.tv/oauth2/token", { method: "POST", body: new URLSearchParams({
|
||||||
client_id: config.twitchClientId,
|
client_id: config.twitchClientId,
|
||||||
|
|
Loading…
Reference in New Issue