Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Jul 18, 2022
1 parent b99facf commit b2c1260
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ namespace App\Http\Livewire\Login;

use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException;
use DanHarrin\LivewireRateLimiting\WithRateLimiting;
use Illuminate\Validation\ValidationException;
use Livewire\Component;

class Login extends Component
Expand All @@ -66,9 +67,9 @@ class Login extends Component
try {
$this->rateLimit(10);
} catch (TooManyRequestsException $exception) {
$this->addError('email', "Slow down! Please wait another $exception->secondsUntilAvailable seconds to log in.");

return;
throw ValidationException::withMessages([
'email' => "Slow down! Please wait another {$exception->secondsUntilAvailable} seconds to log in.",
])
}

// ...
Expand Down

0 comments on commit b2c1260

Please sign in to comment.