From 0f57bf8f9317132b70545387f9cdce6a640fb4e6 Mon Sep 17 00:00:00 2001 From: William Isted <5830878+WilliamIsted@users.noreply.github.com> Date: Tue, 12 Aug 2025 20:41:52 +0100 Subject: [PATCH] Strip "oauth:" prefix from ChannelReward functions - Mirrors existing behaviour from `pubsubConnect` to strip `oauth:` from channel password. - Updates twitchdemo.html with local comfy.js - Fixes #69. --- app.js | 4 ++++ examples/twitchdemo.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 8ad523a..2ff6b86 100644 --- a/app.js +++ b/app.js @@ -1345,6 +1345,7 @@ var comfyJS = { }, GetChannelRewards: async function( clientId, manageableOnly = false ) { if( channelPassword ) { + channelPassword = channelPassword.replace( "oauth:", "" ); if( !channelInfo ) { let info = await fetch( `https://api.twitch.tv/helix/users?login=${mainChannel}`, { headers: { @@ -1368,6 +1369,7 @@ var comfyJS = { }, CreateChannelReward: async function( clientId, rewardInfo ) { if( channelPassword ) { + channelPassword = channelPassword.replace( "oauth:", "" ); if( !channelInfo ) { let info = await fetch( `https://api.twitch.tv/helix/users?login=${mainChannel}`, { headers: { @@ -1394,6 +1396,7 @@ var comfyJS = { }, UpdateChannelReward: async function( clientId, rewardId, rewardInfo ) { if( channelPassword ) { + channelPassword = channelPassword.replace( "oauth:", "" ); if( !channelInfo ) { let info = await fetch( `https://api.twitch.tv/helix/users?login=${mainChannel}`, { headers: { @@ -1420,6 +1423,7 @@ var comfyJS = { }, DeleteChannelReward: async function( clientId, rewardId ) { if( channelPassword ) { + channelPassword = channelPassword.replace( "oauth:", "" ); if( !channelInfo ) { let info = await fetch( `https://api.twitch.tv/helix/users?login=${mainChannel}`, { headers: { diff --git a/examples/twitchdemo.html b/examples/twitchdemo.html index cad976d..c620be5 100644 --- a/examples/twitchdemo.html +++ b/examples/twitchdemo.html @@ -1,6 +1,6 @@ - +