first commit

This commit is contained in:
brusnitsyn
2026-06-24 17:20:43 +09:00
commit 43499acf1c
165 changed files with 25929 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Facades\Audit;
use App\Http\Controllers\Controller;
use App\Http\Requests\Auth\ChangePasswordRequest;
use App\Services\Auth\PasswordManager;
use Illuminate\Http\RedirectResponse;
use Inertia\Inertia;
use Inertia\Response;
/**
* Смена пароля пользователем, в т.ч. принудительная по истечении срока.
*
* Меры ФСТЭК: ИАФ.3 (управление аутентификационной информацией), РСБ.2.
*/
class PasswordController extends Controller
{
public function __construct(private readonly PasswordManager $passwords) {}
/**
* Экран принудительной смены пароля (срок истёк).
*/
public function expired(): Response
{
return Inertia::render('auth/PasswordExpired');
}
public function update(ChangePasswordRequest $request): RedirectResponse
{
$this->passwords->change($request->user(), $request->string('password'));
Audit::log('auth.password.changed', 'change', 'User:'.$request->user()->id);
return redirect()->route('dashboard')->with('status', 'Пароль обновлён.');
}
}