Try out new Rails rate limiting
All checks were successful
Ruby CI / test (pull_request) Successful in 21s

This commit is contained in:
Andrew Tomaka 2025-01-16 22:16:40 -05:00
parent 53ae35d75f
commit 83cedd8a9b
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE

View file

@ -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