diff --git a/app/controllers/api/base_controller.rb b/app/controllers/api/base_controller.rb index 568b3f9a4..05fd722ca 100644 --- a/app/controllers/api/base_controller.rb +++ b/app/controllers/api/base_controller.rb @@ -154,8 +154,11 @@ def require_user! def require_mammoth! header = request.headers['Authorization'] header = header.split.last if header + unless header + Rails.logger.warn { "NO HEADER PROVIDED DECODE #{request}" } + render json: { error: 'This method requires an authenticated user' }, status: 422 + end @decoded = JsonToken.decode(header) - Rails.logger.info { "DECODE #{@decode}" } @decoded end