Why did I not have this message appear?

When you enter the email or password incorrectly more than once
No description
12 Replies
toeknee
toeknee7mo ago
Is this a fresh laravel project? sounds like you have login limiting set
Jorqensen
Jorqensen7mo ago
Looks like he's trying the demo
toeknee
toeknee7mo ago
That'll do it then! I assumed it was a clone of the demo site. Dan will have throttled faked logins
Alnuaimi
AlnuaimiOP7mo ago
When I first created the project, it was working. After a while, I miss it and it disappeared. I don’t know exactly what I did
Jorqensen
Jorqensen7mo ago
It doesn't look like you're on your created project, since the brand logo is the filament one and the credentials are the demo ones. A fresh Filament app usually just have "Laravel" in the brand, from your .env. Are you sure you're actually on your local project here?
Alnuaimi
AlnuaimiOP7mo ago
yes ,yes this image form demo filamentphp
Jorqensen
Jorqensen7mo ago
Unsure what the issue is then. Do you want login throttling in your own app?
Alnuaimi
AlnuaimiOP7mo ago
I want to show this message in my app
Jorqensen
Jorqensen7mo ago
You need to set up throttling then, you can check the demo source code on GitHub: https://github.com/filamentphp/demo
Alnuaimi
AlnuaimiOP7mo ago
How to set up throttling ?
Jorqensen
Jorqensen7mo ago
Seems like the default already throttles attempts for you: https://github.com/filamentphp/filament/blob/3.x/packages/panels/src/Pages/Auth/Login.php#L51-L81 If you want to change this, you need to change the login class used. You can pass it to the ->login() on the panel provider, but the demo page seems to just use the default throttling.
Alnuaimi
AlnuaimiOP6mo ago
I did it ,dose not work
public function authenticate(): ?LoginResponse { try { $this->rateLimit(5); } catch (TooManyRequestsException $exception) { Notification::make() ->title(('filament-panels::pages/auth/login.notifications.throttled.title', [ 'seconds' => $exception->secondsUntilAvailable, 'minutes' => ceil($exception->secondsUntilAvailable / 60), ])) ->body(array_key_exists('body', ('filament-panels::pages/auth/login.notifications.throttled') ?: []) ? __('filament-panels::pages/auth/login.notifications.throttled.body', [ 'seconds' => $exception->secondsUntilAvailable, 'minutes' => ceil($exception->secondsUntilAvailable / 60), ]) : null) ->danger() ->send(); return null; } // Retrieve form data $data = $this->form->getState(); if ($this->getLdapConnectionModel()?->isEnable == true) { $this->attemptLDAPConnection($data); } else { if (!Filament::auth()->attempt($this->getCredentialsFromFormData($data), $data['remember'] ?? false)) { $this->throwFailureValidationException(); } $user = Filament::auth()->user(); if ( ($user instanceof FilamentUser) && (!$user->canAccessPanel(Filament::getCurrentPanel())) ) { Filament::auth()->logout(); $this->throwFailureValidationException(); } session()->regenerate(); } return app(LoginResponse::class); }
Want results from more Discord servers?
Add your server