-
Notifications
You must be signed in to change notification settings - Fork 96
Description
Hi, Apologies if this is the wrong place for this, but not entirely sure where to start.
Recently I found out the client gets hung and never returns a response when using the Get Subscriptions method while having the client setup with A refresh token and a wrong Scope.
How to reproduce:
Generate a new access token, ie using Twitch cli or your favorite method, with the scope [user:read:subscriptions]
Create a new helix client and provide The following Options: UserAccessToken, ClientID and ClientSecret
Make a client.GetSubscriptions() request, response should be returned, with wrong scope error
Add the refresh token to your client options
Make a new request, observe client get hung indefinitely and never return a response.
Sample code:
package main
import (
"fmt"
"log"
helix "github.com/nicklaw5/helix/v2"
)
const (
userID = "YourUserIDHere"
)
func main() {
client, err := helix.NewClient(&helix.Options{
UserAccessToken: "UserAccessToken",
RefreshToken: "RefreshToken",
ClientID: "ClientID",
ClientSecret: "ClientSecret",
})
if err != nil {
log.Fatal("Failed to create new client:", err)
}
resp, err := client.GetSubscriptions(&helix.SubscriptionsParams{
BroadcasterID: userID,
})
if err != nil {
log.Fatal("Failed to get subs:", err)
}
fmt.Println(resp)
}
Hope I'm providing everything you need to track this down. Let me know if you need more details and if I can somehow help.