twitchgate
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -12,2 +12,3 @@ { | ||
"bits:read", | ||
"channel:read:subscriptions", | ||
"clips:edit", | ||
@@ -14,0 +15,0 @@ "user:edit", |
@@ -73,3 +73,3 @@ const express = require(`express`); | ||
const attemptAuthorisedResponse = async (req, res) => { | ||
const attemptAuthorisedResponse = async (req, res, helix = false) => { | ||
let newHeaders = req.headers; | ||
@@ -95,3 +95,3 @@ delete newHeaders.host; | ||
newHeaders.authorization = `OAuth ${config.access_token[channel]}`; | ||
newHeaders.authorization = `${helix ? `Bearer` : `OAuth`} ${config.access_token[channel]}`; | ||
newHeaders[`client-id`] = `${config.client_id}`; | ||
@@ -159,2 +159,5 @@ | ||
}); | ||
app2.all(`/kraken*`, attemptAuthorisedResponse); | ||
app2.all(`/helix*`, async (req, res) => attemptAuthorisedResponse(req, res, true)); | ||
app2.all(`/*`, attemptAuthorisedResponse); | ||
@@ -161,0 +164,0 @@ |
{ | ||
"name": "twitchgate", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"repository": "github:Akhawais/TwitchGate", | ||
@@ -5,0 +5,0 @@ "description": "A REST proxy that silently handles authentication with the Twitch Kraken and Helix APIs.", |
63409
258