26 lines
914 B
PHP
26 lines
914 B
PHP
<?php
|
|
|
|
use App\Http\Controllers\Api\V1\AuthController;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| API V1 Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Routes for API version 1.
|
|
|
|
|
*/
|
|
|
|
// 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');
|
|
});
|