chore: Sidebar icons for new inboxes (#3016)

- Sidebar icons for line and telegram inboxes
- Sentry fix for contact IP lookup job
This commit is contained in:
Sojan Jose
2021-09-15 18:12:56 +05:30
committed by GitHub
parent 2396b59f11
commit a14f4ede87
8 changed files with 41 additions and 15 deletions

View File

@@ -54,13 +54,19 @@ class Rack::Attack
# ref: https://github.com/rack/rack-attack/issues/399
throttle('login/email', limit: 20, period: 5.minutes) do |req|
email = req.params['email'].presence || ActionDispatch::Request.new(req.env).params['email'].presence
email.to_s.downcase.gsub(/\s+/, '') if req.path == '/auth/sign_in' && req.post?
if req.path == '/auth/sign_in' && req.post?
# NOTE: This line used to throw ArgumentError /rails/action_mailbox/sendgrid/inbound_emails : invalid byte sequence in UTF-8
# Hence placed in the if block
email = req.params['email'].presence || ActionDispatch::Request.new(req.env).params['email'].presence
email.to_s.downcase.gsub(/\s+/, '')
end
end
throttle('reset_password/email', limit: 5, period: 1.hour) do |req|
email = req.params['email'].presence || ActionDispatch::Request.new(req.env).params['email'].presence
email.to_s.downcase.gsub(/\s+/, '') if req.path == '/auth/password' && req.post?
if req.path == '/auth/password' && req.post?
email = req.params['email'].presence || ActionDispatch::Request.new(req.env).params['email'].presence
email.to_s.downcase.gsub(/\s+/, '')
end
end
end