Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Ruby
Posted by: Adam Bedell
Added: Aug 16, 2013 1:24 AM
Views: 101
Tags: api rails testing
  1. class CustomAuthFailure < Devise::FailureApp
  2.   def respond
  3.     self.status = 401
  4.     self.content_type = 'json'
  5.     self.response_body = {"errors" => ["Invalid login credentials"]}.to_json
  6.   end
  7. end