rate limit things

This commit is contained in:
Andras Bacsai
2023-08-15 14:27:45 +02:00
parent 88b3005589
commit f8d7c5209e
11 changed files with 90 additions and 9 deletions

View File

@@ -3,10 +3,12 @@
namespace App\Http\Livewire;
use Illuminate\Support\Facades\Hash;
use DanHarrin\LivewireRateLimiting\WithRateLimiting;
use Livewire\Component;
class ForcePasswordReset extends Component
{
use WithRateLimiting;
public string $email;
public string $password;
public string $password_confirmation;
@@ -21,6 +23,7 @@ class ForcePasswordReset extends Component
}
public function submit() {
try {
$this->rateLimit(10);
$this->validate();
auth()->user()->forceFill([
'password' => Hash::make($this->password),