Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions config/initializers/rack_attack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,11 @@ def headers
# increments the count), so requests below the limit are not blocked until
# they hit the limit. At that point, `filter` will return true and block.
user = req.params.fetch('user', {})
email = user['email'].to_s.downcase.strip
email_fingerprint = Pii::Fingerprinter.fingerprint(email) if email.present?
email_fingerprint = nil
if user.is_a?(Hash)
email = user['email'].to_s.downcase.strip
email_fingerprint = Pii::Fingerprinter.fingerprint(email) if email.present?
end
email_and_ip = "#{email_fingerprint}-#{req.remote_ip}"
maxretry = IdentityConfig.store.logins_per_email_and_ip_limit
findtime = IdentityConfig.store.logins_per_email_and_ip_period
Expand Down