diff options
-rw-r--r-- | lib/api.rb | 1 | ||||
-rw-r--r-- | lib/api/helpers.rb | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/api.rb b/lib/api.rb index 5cc78e52850..6882615244b 100644 --- a/lib/api.rb +++ b/lib/api.rb @@ -3,6 +3,7 @@ Dir["#{Rails.root}/lib/api/*.rb"].each {|file| require file} module Gitlab class API < Grape::API format :json + error_format :json helpers APIHelpers mount Users diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index cd2e39bf3a7..424a17b283c 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -5,7 +5,7 @@ module Gitlab end def authenticate! - error!('401 Unauthorized', 401) unless current_user + error!({'message' => '401 Unauthorized'}, 401) unless current_user end end end |