implement auth controller and routes

Wires AuthController (signup, confirmEmail, login, me, logout)
to the existing auth use cases. Routes mounted under /api with
AuthMiddleware on logout/me. RepositoryServiceProvider gains
EmailConfirmationToken and Post bindings; AppServiceProvider
binds the Emailer/EmailFactory and constructs SignupUser with
the configured from-address.
This commit is contained in:
Yisroel Baum 2026-05-06 22:12:51 +03:00
parent 0ffc4b546c
commit 9049f1581b
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
4 changed files with 219 additions and 4 deletions

View file

@ -1,6 +1,17 @@
<?php
// Route registrations land here as the auth, user, post, and comment
// domains come online. Empty for now - the skeleton commit only wires
// up the file so bootstrap/app.php's withRouting(api: ...) has a valid
// target.
use App\Controllers\AuthController;
use App\Http\Middleware\AuthMiddleware;
use Illuminate\Support\Facades\Route;
Route::get('/', function () {
return '';
});
Route::post('/signup', [AuthController::class, 'signup']);
Route::post('/confirm-email', [AuthController::class, 'confirmEmail']);
Route::post('/login', [AuthController::class, 'login']);
Route::post('/logout', [AuthController::class, 'logout'])
->middleware(AuthMiddleware::class);
Route::get('/me', [AuthController::class, 'me'])
->middleware(AuthMiddleware::class);