From 0aeae195cbaec43107f851344a744ed80e6f7737 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 21 Nov 2016 16:19:35 +0100 Subject: [PATCH] Better error message in doorkeeper json response --- app/controllers/api_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index d880400a8f..862358d6ee 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(*)