app/controllers/application_controller.rb
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def check_agent_auth
    if Rails.cache.read("agent-#{session.id}").blank?
      flash[:alert] = "Please login first."
      redirect_to agent_login_url
    end
  end
def check_agent_auth if Rails . cache . read ( "agent-#{session.id}" ) . blank? flash [ :alert ] = "Please login first." redirect_to agent_login_url end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .