diff --git a/lib/discourse_chat/provider.rb b/lib/discourse_chat/provider.rb index 6bbf5c2..45df620 100644 --- a/lib/discourse_chat/provider.rb +++ b/lib/discourse_chat/provider.rb @@ -56,7 +56,7 @@ module DiscourseChat end def self.requires_provider(provider_name) - before_filter do + before_action do raise ProviderDisabled.new unless Provider.enabled_provider_names.include?(provider_name) end end diff --git a/lib/discourse_chat/provider/mattermost/mattermost_command_controller.rb b/lib/discourse_chat/provider/mattermost/mattermost_command_controller.rb index adb65f5..5c102b5 100644 --- a/lib/discourse_chat/provider/mattermost/mattermost_command_controller.rb +++ b/lib/discourse_chat/provider/mattermost/mattermost_command_controller.rb @@ -2,9 +2,9 @@ module DiscourseChat::Provider::MattermostProvider class MattermostCommandController < DiscourseChat::Provider::HookController requires_provider ::DiscourseChat::Provider::MattermostProvider::PROVIDER_NAME - before_filter :mattermost_token_valid?, only: :command + before_action :mattermost_token_valid?, only: :command - skip_before_filter :check_xhr, + skip_before_action :check_xhr, :preload_json, :verify_authenticity_token, :redirect_to_login_if_required, diff --git a/lib/discourse_chat/provider/slack/slack_command_controller.rb b/lib/discourse_chat/provider/slack/slack_command_controller.rb index 6c1a011..e1be95f 100644 --- a/lib/discourse_chat/provider/slack/slack_command_controller.rb +++ b/lib/discourse_chat/provider/slack/slack_command_controller.rb @@ -2,10 +2,10 @@ module DiscourseChat::Provider::SlackProvider class SlackCommandController < DiscourseChat::Provider::HookController requires_provider ::DiscourseChat::Provider::SlackProvider::PROVIDER_NAME - before_filter :slack_token_valid?, only: :command - before_filter :slack_payload_token_valid?, only: :interactive + before_action :slack_token_valid?, only: :command + before_action :slack_payload_token_valid?, only: :interactive - skip_before_filter :check_xhr, + skip_before_action :check_xhr, :preload_json, :verify_authenticity_token, :redirect_to_login_if_required, diff --git a/lib/discourse_chat/provider/telegram/telegram_command_controller.rb b/lib/discourse_chat/provider/telegram/telegram_command_controller.rb index 0e97804..2d7a5db 100644 --- a/lib/discourse_chat/provider/telegram/telegram_command_controller.rb +++ b/lib/discourse_chat/provider/telegram/telegram_command_controller.rb @@ -2,9 +2,9 @@ module DiscourseChat::Provider::TelegramProvider class TelegramCommandController < DiscourseChat::Provider::HookController requires_provider ::DiscourseChat::Provider::TelegramProvider::PROVIDER_NAME - before_filter :telegram_token_valid?, only: :command + before_action :telegram_token_valid?, only: :command - skip_before_filter :check_xhr, + skip_before_action :check_xhr, :preload_json, :verify_authenticity_token, :redirect_to_login_if_required,