From 7278008d7eba091cfdfcdeab5eabf82ce33fa160 Mon Sep 17 00:00:00 2001 From: Elijah Date: Sat, 23 May 2026 10:56:50 -0700 Subject: [PATCH] fix: remove rate limit for authenticated users, increase for public --- backend/main.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/backend/main.go b/backend/main.go index bc9b1f1..bb4f7c7 100644 --- a/backend/main.go +++ b/backend/main.go @@ -127,7 +127,7 @@ func main() { // Public Share Endpoints (Rate Limited) public := app.Group("/api/public") public.Use(limiter.New(limiter.Config{ - Max: 20, + Max: 500, Expiration: 1 * time.Minute, })) public.Post("/share/:id/token", shareHandler.CreateShareToken) @@ -140,12 +140,6 @@ func main() { // === PROTECTED ROUTES (require JWT) === protected := app.Group("/api", middleware.AuthMiddleware(cfg.JWTSecret)) - - // Apply rate limiting to all authenticated endpoints (e.g. 100 req/min) - protected.Use(limiter.New(limiter.Config{ - Max: 100, - Expiration: 1 * time.Minute, - })) // Token refresh protected.Post("/auth/refresh", authHandler.Refresh)