UpdatePasswordResetRequest.php 720 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Http\Requests\V3;
  3. use Illuminate\Foundation\Http\FormRequest;
  4. /**
  5. * `PATCH /v3/password-resets/{token}` 的入参:设新密码。
  6. *
  7. * 长度沿用注册时的 6–32。不用 `Password::defaults()`:它在生产环境要求 12 位
  8. * 混合字符并联网查泄露库,与注册规则不一致,要收紧得注册、重置一起改。
  9. */
  10. class UpdatePasswordResetRequest extends FormRequest
  11. {
  12. public function authorize(): bool
  13. {
  14. return true;
  15. }
  16. /**
  17. * @return array<string, array<int, mixed>>
  18. */
  19. public function rules(): array
  20. {
  21. return [
  22. 'password' => ['required', 'string', 'min:6', 'max:32', 'confirmed'],
  23. ];
  24. }
  25. }