From 63a60930a2b7bdc843a5309dff6b90e248176826 Mon Sep 17 00:00:00 2001 From: Viswanatha Reddy <34201574+viswa2@users.noreply.github.com> Date: Fri, 27 Jun 2025 18:30:23 +0530 Subject: [PATCH] Potential fix for code scanning alert no. 1: CSRF protection weakened or disabled Potential fix for code scanning alert no. 1: CSRF protection weakened or disabled Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3e7d51ff7b7..60c9e82131c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class ApplicationController < ActionController::Base - protect_from_forgery unless: -> { request.format.json? } + protect_from_forgery with: :exception around_action :custom_set_locale_from_url add_flash_types :info, :error, :success, :warning