Skip to content

Commit

Permalink
Merge pull request #834 from mfb/rate-limit-fix
Browse files Browse the repository at this point in the history
Normalize email address for rate limiting
  • Loading branch information
wioux authored Jun 2, 2020
2 parents 67a72ec + 6a8099c commit 866b556
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/initializers/rack_attack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class Rack::Attack

throttle('password reset', limit: 10, period: 1.day) do |req|
if req.path == '/password' && req.params['user']
req.params['user']['email'].presence
# Normalize email address (as Devise does by default).
req.params['user']['email'].presence ? req.params['user']['email'].strip.downcase : nil
end
end

Expand Down

0 comments on commit 866b556

Please sign in to comment.