better error message when API authentication fails

This commit is contained in:
Arpit Jalan
2017-10-20 20:00:13 +05:30
parent df4102466c
commit 804b4f32f8
4 changed files with 4 additions and 3 deletions

View File

@ -171,7 +171,7 @@ class ApplicationController < ActionController::Base
begin
current_user
rescue Discourse::InvalidAccess
return render plain: I18n.t(type), status: status_code
return render plain: I18n.t(opts[:custom_message] || type), status: status_code
end
render html: build_not_found_page(status_code, opts[:include_ember] ? 'application' : 'no_ember')