Browse Source

Throttle IPv6 signup for subnet (#17588)

closed-social-glitch-2
Jeong Arm 2 years ago
committed by GitHub
parent
commit
1de2e3f980
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      config/initializers/rack_attack.rb

+ 3
- 1
config/initializers/rack_attack.rb View File

@ -82,7 +82,9 @@ class Rack::Attack
end
throttle('throttle_sign_up_attempts/ip', limit: 25, period: 5.minutes) do |req|
req.remote_ip if req.post? && req.path == '/auth'
return unless req.post? && req.path == '/auth'
return req.remote_ip.mask(64) if req.remote_ip.ipv6?
req.remote_ip
end
throttle('throttle_password_resets/ip', limit: 25, period: 5.minutes) do |req|

Loading…
Cancel
Save