app/controllers/application_controller.rb
def api_authorize
  	api_cookie = cookies[:apiKey]
  	puts '=======API COOKIE=========='
  	puts api_cookie
  	puts '==========================='
  	if Key.find_by(:secret_key => api_cookie).nil?
  		render json: { :status => 'error', :message => 'invalid or missing api key'}
  	end
  end
# 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 api_authorize
  	api_cookie = cookies[:apiKey]
  	puts '=======API COOKIE=========='
  	puts api_cookie
  	puts '==========================='
  	if Key.find_by(:secret_key => api_cookie).nil?
  		render json: { :status => 'error', :message => 'invalid or missing api key'}
  	end
  end
def api_authorize api_cookie = cookies [ :apiKey ] puts '=======API COOKIE==========' puts api_cookie puts '===========================' if Key . find_by ( :secret_key => api_cookie ) . nil? render json : { :status => 'error' , :message => 'invalid or missing api key' } end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .