Project

General

Profile

Download (341 Bytes) Statistics
| Branch: | Tag: | Revision:
module Foreman
module Controller
module ApiCsrfProtection
extend ActiveSupport::Concern

included do
protect_from_forgery if: :protect_api_from_forgery?
end

private

def protect_api_from_forgery?
session[:user].present? && !session[:api_authenticated_session]
end
end
end
end
(2-2/30)