Method: Devise::FailureApp#http_auth_body

Defined in:
lib/devise/failure_app.rb

#http_auth_bodyObject (protected)



201
202
203
204
205
206
207
208
209
210
211
# File 'lib/devise/failure_app.rb', line 201

def http_auth_body
  return i18n_message unless request_format
  method = "to_#{request_format}"
  if method == "to_xml"
    { error: i18n_message }.to_xml(root: "errors")
  elsif {}.respond_to?(method)
    { error: i18n_message }.send(method)
  else
    i18n_message
  end
end