Return 403 by default for Pundit errors

This commit is contained in:
Andreas Nedbal 2022-11-18 22:52:02 +01:00 committed by Andreas Nedbal
parent 94c9fa12fb
commit 0c9bb05f29

View file

@ -26,6 +26,8 @@ module Justask
config.i18n.fallbacks = [I18n.default_locale]
config.i18n.enforce_available_locales = false
config.action_dispatch.rescue_responses["Pundit::NotAuthorizedError"] = :forbidden
config.after_initialize do
Dir.glob Rails.root.join('config/late_initializers/*.rb') do |f|
require f