From eda889e166f4083100603c8277cd01020e754246 Mon Sep 17 00:00:00 2001 From: Parsa Aghayi Date: Mon, 2 Nov 2026 17:25:41 +0000 Subject: [PATCH] fix(rate-limit): configure trusted proxies and relax newsletter throttle limit --- bootstrap/app.php | 1 + routes/api.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrap/app.php b/bootstrap/app.php index fd1a790..2057f7a 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -27,6 +27,7 @@ return Application::configure(basePath: dirname(__DIR__)) // Let the Next.js admin panel authenticate with a Sanctum session // cookie issued on the same registrable domain, instead of shipping a // bearer token to JavaScript. + $middleware->trustProxies(at: '*'); $middleware->statefulApi(); $middleware->api(prepend: [ diff --git a/routes/api.php b/routes/api.php index c61a234..bcc496e 100644 --- a/routes/api.php +++ b/routes/api.php @@ -94,7 +94,7 @@ Route::post('contact', [ContactMessageController::class, 'store']) */ Route::post('newsletter/subscribe', [NewsletterSubscriptionController::class, 'subscribe']) - ->middleware('throttle:5,1'); + ->middleware('throttle:15,1'); /* |--------------------------------------------------------------------------