Method: OAuth2::Provider::Rack::Responses.json_error

Defined in:
lib/oauth2/provider/rack/responses.rb

.json_error(error, options = {}) ⇒ Object



14
15
16
17
# File 'lib/oauth2/provider/rack/responses.rb', line 14

def self.json_error(error, options = {})
  description = %{, "error_description": "#{options[:description]}"} if options[:description]
  [options[:status] || 400, {'Content-Type' => 'application/json'}, [%{{"error": "#{error}"#{description}}}]]
end