From 284dee21c71413ec19104339770b5b77c9b0f1bc Mon Sep 17 00:00:00 2001 From: arzumify Date: Mon, 24 Mar 2025 21:23:38 +0000 Subject: [PATCH] Fixed broken betting --- main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index c136d67..131ec8a 100644 --- a/main.go +++ b/main.go @@ -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 }