Files
laravel-gost-template/app/Http/Requests/Auth/ChangePasswordRequest.php
2026-06-24 17:20:43 +09:00

35 lines
796 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace App\Http\Requests\Auth;
use App\Rules\PasswordNotReused;
use App\Support\PasswordPolicy;
use Illuminate\Foundation\Http\FormRequest;
/**
* Смена пароля с проверкой политики и истории (меры ИАФ.3).
*/
class ChangePasswordRequest extends FormRequest
{
public function authorize(): bool
{
return $this->user() !== null;
}
/**
* @return array<string, mixed>
*/
public function rules(): array
{
return [
'current_password' => ['required', 'current_password'],
'password' => [
'required',
'confirmed',
PasswordPolicy::rule(),
new PasswordNotReused($this->user()),
],
];
}
}