feat: Unify user and super admin credentials (#3830)
Fixes: #3061, #3489
This commit is contained in:
@@ -72,6 +72,15 @@ class Rack::Attack
|
||||
end
|
||||
end
|
||||
|
||||
throttle('super_admin_login/email', limit: 20, period: 5.minutes) do |req|
|
||||
if req.path == '/super_admin/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|
|
||||
if req.path == '/auth/password' && req.post?
|
||||
email = req.params['email'].presence || ActionDispatch::Request.new(req.env).params['email'].presence
|
||||
|
||||
@@ -303,7 +303,6 @@ Rails.application.routes.draw do
|
||||
# order of resources affect the order of sidebar navigation in super admin
|
||||
resources :accounts
|
||||
resources :users, only: [:index, :new, :create, :show, :edit, :update]
|
||||
resources :super_admins
|
||||
resources :access_tokens, only: [:index, :show]
|
||||
resources :installation_configs, only: [:index, :new, :create, :show, :edit, :update]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user