From fcf64831272a1aaf20fde0d8001714994ccc6932 Mon Sep 17 00:00:00 2001 From: Jean-Marc Strauven Date: Fri, 2 Jan 2026 17:53:45 +0100 Subject: [PATCH] fix: clean up routes after merge conflict --- routes/api.php | 18 ++---------------- routes/api/v1.php | 12 +++++++----- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/routes/api.php b/routes/api.php index b91f0be..c09e1e7 100644 --- a/routes/api.php +++ b/routes/api.php @@ -14,19 +14,5 @@ | */ -// Version 1 - Current stable version -ApiRoute::version('v1', function () { - // Public routes with auth rate limiter (5/min - brute force protection) - Route::middleware('throttle:auth')->group(function () { - Route::post('register', [AuthController::class, 'register'])->name('api.v1.register'); - Route::post('login', [AuthController::class, 'login'])->name('api.v1.login'); - }); - - // Protected routes with authenticated rate limiter (120/min) - Route::middleware(['auth:sanctum', 'throttle:authenticated'])->group(function () { - Route::post('logout', [AuthController::class, 'logout'])->name('api.v1.logout'); - Route::get('me', [AuthController::class, 'me'])->name('api.v1.me'); - }); -}) - ->current() - ->rateLimit(60); // Global rate limit: 60 requests/minute for v1 +// Routes are now loaded automatically from config/apiroute.php +// See routes/api/v1.php for version 1 routes diff --git a/routes/api/v1.php b/routes/api/v1.php index f0d0012..3cf5325 100644 --- a/routes/api/v1.php +++ b/routes/api/v1.php @@ -12,12 +12,14 @@ use Illuminate\Support\Facades\Route; | */ -// Public routes -Route::post('register', [AuthController::class, 'register'])->name('api.v1.register'); -Route::post('login', [AuthController::class, 'login'])->name('api.v1.login'); +// Public routes with auth rate limiter (5/min - brute force protection) +Route::middleware('throttle:auth')->group(function () { + Route::post('register', [AuthController::class, 'register'])->name('api.v1.register'); + Route::post('login', [AuthController::class, 'login'])->name('api.v1.login'); +}); -// Protected routes -Route::middleware('auth:sanctum')->group(function () { +// Protected routes with authenticated rate limiter (120/min) +Route::middleware(['auth:sanctum', 'throttle:authenticated'])->group(function () { Route::post('logout', [AuthController::class, 'logout'])->name('api.v1.logout'); Route::get('me', [AuthController::class, 'me'])->name('api.v1.me'); });