test borked

This commit is contained in:
Dan Baker 2026-02-22 17:49:23 +00:00
parent 49b528a66b
commit 2418edccfd
29 changed files with 2036 additions and 121 deletions

View file

@ -1,8 +1,18 @@
<?php
use App\Services\MagicLinkAuthService;
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schedule;
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
// Scheduled task to clean up expired magic login tokens
Schedule::call(function () {
$service = app(MagicLinkAuthService::class);
$deleted = $service->cleanupExpiredTokens();
Log::info("Cleaned up {$deleted} expired magic login tokens");
})->daily();

View file

@ -1,7 +1,25 @@
<?php
use App\Http\Controllers\Auth\MagicLinkController;
use Illuminate\Support\Facades\Route;
Route::get('/', function () {
return view('welcome');
});
// Guest routes (unauthenticated users)
Route::middleware('guest')->group(function () {
Route::get('/login', [MagicLinkController::class, 'showLoginForm'])->name('login');
Route::post('/login', [MagicLinkController::class, 'sendLink'])->name('magic-link.send');
Route::get('/verify-code', [MagicLinkController::class, 'showCodeForm'])->name('verify-code');
Route::post('/verify-code', [MagicLinkController::class, 'verifyCode'])->name('magic-link.verify-code');
Route::get('/auth/magic-link', [MagicLinkController::class, 'verifyLink'])->name('magic-link.verify');
});
// Authenticated routes
Route::middleware('auth')->group(function () {
Route::post('/logout', [MagicLinkController::class, 'logout'])->name('logout');
Route::get('/dashboard', function () {
return view('dashboard');
})->name('dashboard');
});