<?php

use Illuminate\Support\Facades\Route;
use Modules\Identity\Http\Controllers\RegistrationController;
use Modules\Identity\Http\Controllers\TokenController;

Route::prefix('api/v1')->middleware(['api', 'throttle:api-auth'])->group(function () {
    Route::post('/auth/token', [TokenController::class, 'store'])->name('identity.auth.token');

    Route::post('/auth/registration/request-code', [RegistrationController::class, 'requestCode'])
        ->middleware('throttle:api-otp')
        ->name('identity.auth.registration.request-code');
    Route::post('/auth/registration/verify-code', [RegistrationController::class, 'verifyCode'])
        ->name('identity.auth.registration.verify-code');
    Route::post('/auth/register', [RegistrationController::class, 'store'])
        ->name('identity.auth.register');
});
