first commit
This commit is contained in:
38
app/Http/Controllers/Auth/PasswordController.php
Normal file
38
app/Http/Controllers/Auth/PasswordController.php
Normal 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', 'Пароль обновлён.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user