<?php

use Illuminate\Support\Facades\Route;
use Kylin\Auth\Http\Controllers\AuthController;

Route::prefix('kylin/auth')->group(function () {
    // 登录/注册/验证码 - 严格限流：5次/分钟
    Route::middleware('kylin.rate_limit:5,1')->group(function () {
        Route::post('/login', [AuthController::class, 'login']);
        Route::post('/register', [AuthController::class, 'register']);
        Route::post('/captcha', [AuthController::class, 'captcha']);
    });

    Route::middleware('auth:sanctum')->group(function () {
        Route::get('/me', [AuthController::class, 'me']);
        Route::post('/logout', [AuthController::class, 'logout']);
        Route::post('/refresh', [AuthController::class, 'refresh']);
    });
});
