application_controller.rb 344 Bytes
Newer Older
Florian Hübsch's avatar
Florian Hübsch committed
1
2
3
4
5
class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception
  before_action :authenticate_user!
Fernando D'Agostino's avatar
Fernando D'Agostino committed
6
  protect_from_forgery with: :null_session, if: Proc.new { |c| c.request.format == 'application/json' }
Florian Hübsch's avatar
Florian Hübsch committed
7
end