debug: add JWT secret empty check logging
Build and Deploy / build (push) Successful in 2m43s
Build and Deploy / deploy (push) Has been skipped

This commit is contained in:
2026-07-16 23:56:30 +00:00
parent eb995760f7
commit ad9000c3d9
+6 -1
View File
@@ -1,6 +1,7 @@
package middleware
import (
"log"
"net/http"
"strings"
"time"
@@ -39,7 +40,11 @@ func JWTAuth() gin.HandlerFunc {
claims := &Claims{}
token, err := jwt.ParseWithClaims(tokenString, claims, func(token *jwt.Token) (interface{}, error) {
return []byte(config.Cfg.JWT.Secret), nil
secret := config.Cfg.JWT.Secret
if secret == "" {
log.Printf("JWT Secret is empty, config.Cfg: %+v", config.Cfg)
}
return []byte(secret), nil
})
if err != nil || !token.Valid {