Skip to main content
Launch Crate

Rate Limiting Logins Without Locking Out Real Users

Date
Jun 11, 2026
Author
Ines Carvalho
Read time
2 min
Views
1,260

Sliding windows, per-IP buckets and friendly error messages: our approach to brute-force protection.

We publish security fixes as point releases with a short advisory, and the admin shows a banner until the update is installed.

The threat

New installs require two-factor authentication for every admin account. Recovery codes are shown once and can be regenerated from the profile screen.

Login attempts are rate limited per account and per IP address with a sliding window, which slows attackers without locking out real users.

  • Two-factor authentication on by default
  • Sliding-window login rate limits
  • CSRF tokens on every form
  • Signed and timed password reset links

“Security is a process, not a product.”

— Bruce Schneier

Our default

Every form carries a CSRF token, and every state-changing request is checked on the server, not just hidden in the interface.

RateLimiter::for('login', function (Request $request) {
    return Limit::perMinute(5)->by($request->input('email') . $request->ip());
});

How to change it

Hardware security keys work anywhere two-factor codes do, and we recommend them for anyone with access to payments.

Sessions expire after a period of inactivity that each site owner can tune from the security settings.

Secrets are read from the environment at runtime and never written to the database or the logs.

Security defaults matter more than security options, because most people never change a default.

How we work on posts like this

We keep posts updated rather than writing new ones for every small change. When a step changes in a later release, the post gets an edit note at the top with the date and the version, so returning readers can see what moved without rereading everything.

Mistakes stay visible. If a post turns out to be wrong, we correct it in place, mark the correction and explain what we got wrong, rather than quietly swapping the text. Readers trust a build log more when they can see it being honest about its errors.

Our editing rule of thumb is to cut anything that would not change what the reader does next. Background and history are welcome when they explain a decision, but a post that only tells a story without leaving the reader able to do something is usually a draft that is not finished yet.

Finally, every post gets a real person as its author. The name on the card is the person who did the work and who will answer the comments, which keeps the writing specific and gives readers someone to hold to account when something does not work as described.

Every post on this blog starts as a note in the issue that shipped the change. When the work is done, whoever built it writes a first draft while the details are still fresh, and someone who did not work on it edits the draft for clarity. That second reader catches the jargon and the missing steps that the author can no longer see.

Questions or a better approach? Leave a comment below, or reply to the build-log email and we will fold the best ideas into the next release.

10 Comments Discussion
  1. Aiko Tanaka 6:04 am

    Clear, practical and no fluff. Thank you.

    1. Freya Nilsen 8:28 am

      Same here, this saved me an afternoon.

      1. Mateo Silva 2:06 am

        Seconding this request.

    2. Arjun Mehta 2:15 am

      Seconding this request.

  2. Freya Nilsen 6:53 pm

    Small nitpick: the second step assumes Redis is already installed. Might be worth a note.

  3. Lena Hart 4:28 pm

    Bookmarked. Our support team is going to use this as onboarding material.

  4. Arjun Mehta 1:59 pm

    How long did this take you end to end? Trying to plan our own migration.

    1. Ines Carvalho Author 1:31 pm

      Good catch, I have updated the post with a note about it.

    2. Ines Carvalho Author 12:08 am

      Glad it helped. Let us know how the migration goes.

  5. Freya Nilsen 12:15 am

    Would you share the full config file? The snippet is helpful but I am missing context.

Comments are closed.
Version 3.2 is out

Ship your next Side Project Faster

One-command install • 14 payment and login providers • 9 starter themes • Admin dashboard • Search-ready pages • Installable app

PHP 8.4 Laravel 12 Tailwind 4 Vite PWA