Skip to content

Commit

Permalink
User should now return from helix, forgot twitch returns a data object
Browse files Browse the repository at this point in the history
  • Loading branch information
p0t4t0sandwich committed Apr 24, 2024
1 parent dc8c60c commit 48ea74a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/auth/linking/twitch.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,14 @@ func GetTwitchUser(accessToken string) (*TwitchData, error) {
return nil, errors.New("failed to get user data")
}

var data TwitchData
var data struct {
Data []TwitchData `json:"data"`
}
err = json.NewDecoder(resp.Body).Decode(&data)
if err != nil {
return nil, err
}
return &data, nil
return &data.Data[0], nil
}

// TwitchOAuth process the Twitch OAuth flow
Expand Down

0 comments on commit 48ea74a

Please sign in to comment.