added logout

This commit is contained in:
Mephimeow
2026-06-12 10:18:04 +00:00
parent 130d5d5e3d
commit a26cd891e4
11 changed files with 244 additions and 5 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ func AuthMiddleware(jwtSecret []byte) gin.HandlerFunc {
}
parts := strings.SplitN(authHeader, " ", 2)
if len(parts) != 2 || parts[0] != "Bearer" {
if len(parts) != 2 || !strings.EqualFold(parts[0], "Bearer") {
c.AbortWithStatusJSON(http.StatusUnauthorized, ErrorResponse{Error: "invalid authorization header format"})
return
}