fix: clean up routes after merge conflict

This commit is contained in:
Jean-Marc Strauven
2026-01-02 17:53:45 +01:00
parent 6c24d290f4
commit fcf6483127
2 changed files with 9 additions and 21 deletions

View File

@@ -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

View File

@@ -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');
});