Why did I not have this message appear?

When you enter the email or password incorrectly more than once
No description
12 Replies
toeknee
toeknee5mo ago
Is this a fresh laravel project? sounds like you have login limiting set
Jorqensen
Jorqensen5mo ago
Looks like he's trying the demo
toeknee
toeknee5mo ago
That'll do it then! I assumed it was a clone of the demo site. Dan will have throttled faked logins
Alnuaimi
AlnuaimiOP5mo 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
Jorqensen5mo 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
AlnuaimiOP5mo ago
yes ,yes this image form demo filamentphp
Jorqensen
Jorqensen5mo ago
Unsure what the issue is then. Do you want login throttling in your own app?
Alnuaimi
AlnuaimiOP5mo ago
I want to show this message in my app
Jorqensen
Jorqensen5mo ago
You need to set up throttling then, you can check the demo source code on GitHub: https://github.com/filamentphp/demo
Alnuaimi
AlnuaimiOP5mo ago
How to set up throttling ?
Jorqensen
Jorqensen5mo 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
AlnuaimiOP5mo 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