<?php

use Illuminate\Support\Facades\Route;
use Modules\DemoLogin\Http\Controllers\DemoLoginController;

/*
 * Demo-only passwordless quick-login. The controller hard-gates every action on
 * config('demologin.enabled') (env DEMO_LOGIN), so these 404 in production.
 * No `auth` middleware — this is how an unauthenticated visitor signs in.
 */
Route::middleware(['web'])->prefix('demo')->group(function () {
    // /demo            -> project chooser
    // /demo/{project}  -> that project's page (role cards + a normal-login button)
    // /demo/{project}/login/{role} -> passwordless sign-in as that role
    Route::get('/', [DemoLoginController::class, 'index'])->name('demo.index');
    Route::get('/{project}', [DemoLoginController::class, 'project'])->name('demo.project');
    Route::get('/{project}/login/{role}', [DemoLoginController::class, 'login'])->name('demo.login');
});
