From 83cedd8a9b96f4113f2eef27ef15d999676cc8cd Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 16 Jan 2025 22:16:40 -0500 Subject: [PATCH] Try out new Rails rate limiting --- app/controllers/sessions_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 3bf7328..cd3ab5d 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,5 +1,6 @@ class SessionsController < ApplicationController require_unregistered_user only: %i[new create] + rate_limit to: 5, within: 1.minute, only: :create, with: -> { redirect_to new_session_url, alert: "Cannot currently login" } # GET /sessions/new def new @session = Session.new -- 2.45.2