From b625f024f3bee4305f8b74c5e8997129474dede1 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Wed, 13 May 2026 16:04:50 +0200 Subject: [PATCH] fix: allow static and dist paths to bypass auth middleware --- internal/auth/middleware/middleware.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/auth/middleware/middleware.go b/internal/auth/middleware/middleware.go index ec2c14f..bd7a420 100644 --- a/internal/auth/middleware/middleware.go +++ b/internal/auth/middleware/middleware.go @@ -9,8 +9,10 @@ import ( func AuthMiddleware(svc domain.AuthService) gin.HandlerFunc { return func(c *gin.Context) { - // Allow access to login and logout endpoints without authentication - if c.Request.URL.Path == "/login" || c.Request.URL.Path == "/logout" { + // Allow access to login, logout and static assets without authentication + if c.Request.URL.Path == "/login" || c.Request.URL.Path == "/logout" || + len(c.Request.URL.Path) >= 7 && c.Request.URL.Path[:7] == "/static" || + len(c.Request.URL.Path) >= 5 && c.Request.URL.Path[:5] == "/dist" { c.Next() return }