Rate limit Fortify login attempts

Fortify's login limiter is five attempts a minute. The Vue page shows the message on the username field.

For your AI agent

Copies a prompt. Paste it into the AI agent you already have open.

Read https://laravel-vuejs.space/laravel-login-rate-limit-vue.md
Fortify's login limiter is five attempts a minute. The Vue page shows the message on the username field.
Do not clear cookies to bypass it.
Do not key the limiter on the IP alone if you expect an office to share one address, and do not key it on the email alone if one password can be tried from anywhere.
Show the diff. Do not commit.
On this page · 3 sections
  1. The fix
  2. What to avoid
  3. FAQ

People searching “Laravel login rate limit” raise the limit until the lockout “goes away”. The lockout is the feature. The Vue starter kit registers a limiter named login in App\Providers\FortifyServiceProvider. The Fortify guide is the form that trips it.

TL;DR

  • Fortify’s login limiter is five attempts a minute.
  • The Vue page shows the message on the username field.
  • Do not clear cookies to bypass it.
  • Do not key the limiter on the IP alone if you expect an office to share one address, and do not key it on the email alone if one password can be tried from anywhere.

Who it's for: Laravel + Vue developers

Applies to: Laravel 13 · Vue 3

The fix#

php
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Str;
use Laravel\Fortify\Fortify;

RateLimiter::for('login', function (Request $request) {
    $key = Str::transliterate(Str::lower($request->input(Fortify::username())).'|'.$request->ip());

    return Limit::perMinute(5)->by($key);
});

Five failures for that email and IP return a validation error. Show it the same way as a wrong password:

vue
<p v-if="form.errors.email">{{ form.errors.email }}</p>

What to avoid#

Gotcha

Do not clear cookies to bypass it. Do not key the limiter on the IP alone if you expect an office to share one address, and do not key it on the email alone if one password can be tried from anywhere. The pair above is Fortify’s default.

FAQ#

How do I rate limit Fortify login attempts?

Fortify's login limiter is five attempts a minute. The Vue page shows the message on the username field.

What goes wrong with Laravel login rate limit?

Many developers raise the limit until the lockout "goes away". Do not clear cookies to bypass it.

Found this useful?

Ask questions, share what you built.

Join thousands of Laravel and Vue developers in our Facebook group, or get new posts in your Telegram feed. Sharing this article helps too.

Keep reading

Newsletter

Get the best of Laravel & Vue, once a month.

One short email with new guides, release notes worth reading and hand-picked community links. No spam, unsubscribe any time.