FIX: Multiply ratelimiter leniency for own discobot certs (#13639)
This commit is contained in:
parent
cf63931b9e
commit
38332cae21
|
@ -97,7 +97,11 @@ after_initialize do
|
|||
raise Discourse::InvalidParameters.new("#{key} must be present") unless params[key]&.present?
|
||||
end
|
||||
|
||||
if params[:user_id].to_i != current_user.id
|
||||
rate_limiter = RateLimiter.new(current_user, 'svg_certificate', 3, 1.minute)
|
||||
else
|
||||
rate_limiter = RateLimiter.new(current_user, 'svg_certificate_self', 30, 10.minutes)
|
||||
end
|
||||
rate_limiter.performed! unless current_user.staff?
|
||||
|
||||
user = User.find_by(id: params[:user_id])
|
||||
|
|
Loading…
Reference in New Issue