Fixed broken betting

This commit is contained in:
Tracker-Friendly 2025-03-24 21:23:38 +00:00
parent 6282648ab6
commit 284dee21c7

10
main.go
View file

@ -596,15 +596,15 @@ func main() {
return
}
// Authenticate the user
accessToken := c.GetHeader("Authorization")
if accessToken == "" {
c.JSON(400, gin.H{"error": "No token provided"})
// Get the user's channel ID
id, ok := sessions[c.ClientIP()]
if !ok {
c.JSON(403, gin.H{"error": "Invalid token"})
return
}
// Check if the user is a moderator
if !userIsModerator(accessToken) {
if !userIsModerator(id) {
c.JSON(403, gin.H{"error": "You must be a moderator to end a bet"})
return
}