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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Authenticate the user
|
// Get the user's channel ID
|
||||||
accessToken := c.GetHeader("Authorization")
|
id, ok := sessions[c.ClientIP()]
|
||||||
if accessToken == "" {
|
if !ok {
|
||||||
c.JSON(400, gin.H{"error": "No token provided"})
|
c.JSON(403, gin.H{"error": "Invalid token"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the user is a moderator
|
// 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"})
|
c.JSON(403, gin.H{"error": "You must be a moderator to end a bet"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue