I am using Laravel 11 and Jetstream. For the login, after 5 unsuccessful attempts, an error page with code 429 is displayed to me, as shown in the image below.
However, I need the error message, along with the remaining time, to be displayed on the same login page. As shown in the image below.
in FortifyServiceProvider
public function boot(): void
{
RateLimiter::for('login', function (Request $request) {
$throttleKey = Str::transliterate(Str::lower($request->input(Fortify::username())).'|'.$request->ip());
return Limit::perMinute(5)->by($throttleKey);
});
....
I would appreciate it if you could guide me on how to display the error message as shown in the image above.
@shimana note that you also have the option to write an implementation of Laravel\Fortify\Contracts\LockoutResponse and bind it into the container if the logic requires it