Commit d272d13

mo khan <mo@mokhan.ca>
2014-11-13 04:37:26
disable csrf check for api and gracefully join backtrace.
1 parent a0abb44
Changed files (2)
app
controllers
views
app/controllers/api/v1/api_controller.rb
@@ -2,6 +2,7 @@ module Api
   module V1
     class ApiController < ApplicationController
       before_action :authenticate
+      skip_before_action :verify_authenticity_token
       skip_before_action :ensure_valid_session
       attr_reader :current_environment
 
app/views/failures/_failure.json.jbuilder
@@ -2,5 +2,5 @@ json.id failure.id
 json.message failure.message
 json.hostname failure.hostname
 json.error_type failure.error_type
-json.backtrace failure.backtrace.join(' ')
+json.backtrace failure.try(:backtrace).try(:join, ' ')
 json.environment failure.environment.id