Fixed broken betting
This commit is contained in:
parent
6282648ab6
commit
284dee21c7
1 changed files with 5 additions and 5 deletions
10
main.go
10
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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue