Class: Remotty::Rails::Authentication::JsonAuthFailure
- Inherits:
-
Devise::FailureApp
- Object
- Devise::FailureApp
- Remotty::Rails::Authentication::JsonAuthFailure
- Defined in:
- lib/remotty/rails/authentication/json_auth_failure.rb
Overview
return json Device error occur
Instance Method Summary collapse
Instance Method Details
#http_auth_body ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/remotty/rails/authentication/json_auth_failure.rb', line 5 def http_auth_body return unless request_format method = "to_#{request_format}" if method == "to_xml" { error: { code: "UNAUTHORIZED", message: } }.to_xml(:root => "errors") elsif {}.respond_to?(method) { error: { code: "UNAUTHORIZED", message: } }.send(method) else end end |
#respond ⇒ Object
28 29 30 |
# File 'lib/remotty/rails/authentication/json_auth_failure.rb', line 28 def respond http_auth end |