mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
DEV: Move logic for rate limiting user second factor to one place (#11941)
This moves all the rate limiting for user second factor (based on `params[:second_factor_token]` existing) to the one place, which rate limits by IP and also by username if a user is found.
This commit is contained in:
@ -77,7 +77,7 @@ class UsersEmailController < ApplicationController
|
||||
|
||||
redirect_url = path("/u/confirm-new-email/#{params[:token]}")
|
||||
|
||||
RateLimiter.new(nil, "second-factor-min-#{request.remote_ip}", 3, 1.minute).performed! if params[:second_factor_token].present?
|
||||
rate_limit_second_factor!(@user)
|
||||
|
||||
if !@error
|
||||
# this is needed becase the form posts this field as JSON and it can be a
|
||||
|
Reference in New Issue
Block a user