Browse Source

Fix error when trying to register (#17600)

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

+ 4
- 5
config/initializers/rack_attack.rb View File

@ -83,11 +83,10 @@ class Rack::Attack
throttle('throttle_sign_up_attempts/ip', limit: 25, period: 5.minutes) do |req|
if req.post? && req.path == '/auth'
if req.remote_ip.ipv6?
req.remote_ip.mask(64)
else
req.remote_ip
end
addr = req.remote_ip
addr = IPAddr.new(addr) if addr.is_a?(String)
addr = addr.mask(64) if addr.ipv6?
addr.to_s
end
end

Loading…
Cancel
Save