Add phone-verified user registration

Two-step flow: request a one-time code by email/phone (RegistrationVerification,
mailed via RegistrationCodeMail, rate-limited by the new api-otp limiter keyed
to the identifier), then verify the code and register with RegistrationController.
User gains a phone column/fillable.
This commit is contained in:
Nyan Lin Paing
2026-08-30 14:53:18 +07:00
parent b6934e1fb5
commit 914b7f97f3
14 changed files with 677 additions and 0 deletions
@@ -1,8 +1,17 @@
<?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');
});