This commit is contained in:
2024-10-24 16:43:06 +08:00
parent efe39dda4d
commit 104195b977
7 changed files with 142 additions and 15 deletions

View File

@@ -136,8 +136,8 @@ func (s *Server) handleWebSocket(c *gin.Context) {
func AuthMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
if config.GlobalConfig.Auth.Token == "" ||
c.Query("token") == config.GlobalConfig.Auth.Token {
if config.GlobalConfig.Server.Token == "" ||
c.Query("token") == config.GlobalConfig.Server.Token {
c.Next()
} else {
c.AbortWithStatus(http.StatusUnauthorized)