Try out new Rails rate limiting #53

Merged
atomaka merged 1 commit from add-rate-limiting into main 2025-01-16 22:19:35 -05:00
Showing only changes of commit 83cedd8a9b - Show all commits

View file

@ -1,5 +1,6 @@
class SessionsController < ApplicationController class SessionsController < ApplicationController
require_unregistered_user only: %i[new create] 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 # GET /sessions/new
def new def new
@session = Session.new @session = Session.new