Allow a custom value for $maxAttempts in the the Filament\Pages\Auth\Register class' rate limiter #13441
thierrymaasdam
started this conversation in
Ideas
Replies: 1 comment
-
I needed this as well. In my panel provider, I did <?php
class Register extends \Filament\Pages\Auth\Register
{
use WithRateLimiting {
WithRateLimiting::rateLimit as baseRateLimit;
}
protected function rateLimit($maxAttempts, $decaySeconds = 60, $method = null, $component = null): void
{
// set the *actual* $maxAttempts rate limit you want here
$this->baseRateLimit(5, $decaySeconds, $method, $component);
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TLDR
Allow a custom value for
$maxAttempts
in the theFilament\Pages\Auth\Register
class' rate limiterCurrent situation
Within
Filament\Pages\Auth\Register::register()
, the$maxAttempts
parameter of the rate limiter is now hard-coded to2
. We have noticed that this causes users to abort their registration with our SaaS product, as they need to wait for a minute after they have made two mistakes in the registration form in a row. It actually happened on a demo call and was slightly awkward.Our own solution
We now have copied the
register()
method on theFilament\Pages\Auth\Register
class for the sake of setting custom values for the rate limiter.Optimal scenario
Maybe other Filament users would also like to set custom values for the rate limiter. For that reason, I figured it might be useful to drop the feature request here: what if the values for the rate limiter could be set dynamically within the
Filament\Pages\Auth\Register
class?I look forward to hearing from you. Enjoy your day.
Beta Was this translation helpful? Give feedback.
All reactions