Try out new Rails rate limiting #53
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue