Give the machine console its own session with PIN sign-in, make counters cumulative

The console under console/ has its own session cookie and console guard
(UseConsoleSession), so signing out or changing user there leaves the
normal interface alone. Links open it in a new window through a one-time
handoff key; a signed-out console asks for a PIN code or password on its
own login page. Users set their 4-6 digit PIN on the profile's PIN page,
and the console's change user dialog takes it on a keypad; five wrong
PINs lock PIN sign-in for 15 minutes.

Machine counters are cumulative: users record how much a job used and it
is added to the latest reading. A maintenance record restarts the whole
counter interval from the reading at the record.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-29 09:58:11 +02:00
co-authored by Claude Sonnet 5.5
parent 87e38260dc
commit 32c33e2a64
55 changed files with 1660 additions and 194 deletions
@@ -1,5 +1,7 @@
<?php
use App\Modules\Users\Presentation\Http\Controllers\ConsoleHandoff;
use App\Modules\Users\Presentation\Http\Controllers\ConsoleLogoutController;
use App\Modules\Users\Presentation\Http\Controllers\LogoutController;
use App\Modules\Users\Presentation\Http\Controllers\SwitchLocaleController;
use Illuminate\Support\Facades\Route;
@@ -12,8 +14,17 @@ Route::middleware(['web', 'guest'])->group(function () {
Route::livewire('/reset-password/{token}', 'users::reset-password')->name('password.reset');
});
// The machine console's own session (UseConsoleSession: paths under console/).
Route::middleware('web')->prefix('console')->name('console.')->group(function () {
Route::livewire('/login', 'users::console-login')->middleware('guest')->name('login');
Route::get('/handoff/{token}', [ConsoleHandoff::class, 'accept'])->middleware('throttle:30,1')->name('handoff.accept');
Route::post('/logout', ConsoleLogoutController::class)->middleware('auth')->name('logout');
});
Route::middleware(['web', 'auth'])->group(function () {
Route::post('/logout', LogoutController::class)->name('logout');
Route::livewire('/profile/pin', 'users::pin')->middleware('can:machines.use')->name('profile.pin');
Route::get('/console-handoff', [ConsoleHandoff::class, 'start'])->middleware('throttle:30,1')->name('console.handoff');
Route::middleware('can:users.manage')
->prefix('users')