mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-16 20:49:28 +00:00
rate limit things
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Livewire;
|
||||
|
||||
use App\Jobs\SendConfirmationForWaitlistJob;
|
||||
use App\Models\User;
|
||||
use App\Models\Waitlist as ModelsWaitlist;
|
||||
use Livewire\Component;
|
||||
|
||||
@@ -24,6 +25,11 @@ class Waitlist extends Component
|
||||
{
|
||||
$this->validate();
|
||||
try {
|
||||
$already_registered = User::whereEmail($this->email)->first();
|
||||
if ($already_registered) {
|
||||
$this->emit('success', 'You are already registered (Thank you 💜).');
|
||||
return;
|
||||
}
|
||||
$found = ModelsWaitlist::where('email', $this->email)->first();
|
||||
ray($found);
|
||||
if ($found) {
|
||||
|
||||
Reference in New Issue
Block a user