From: Eugen Rochko Date: Mon, 21 Nov 2016 15:19:35 +0000 (+0100) Subject: Better error message in doorkeeper json response X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=627a85f4e4019248ea1bfb68a6536a726d8f8f69;p=mastodon.git Better error message in doorkeeper json response --- diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index d880400a8..862358d6e 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -30,8 +30,8 @@ class ApiController < ApplicationController render json: { error: 'Remote SSL certificate could not be verified' }, status: 503 end - def doorkeeper_unauthorized_render_options(*) - { json: { error: 'Not authorized' } } + def doorkeeper_unauthorized_render_options(error: nil) + { json: { error: (error.try(:description) || 'Not authorized') } } end def doorkeeper_forbidden_render_options(*)