From 18196c0a0a340afb57a42923f7591ae8390a174f Mon Sep 17 00:00:00 2001 From: Chris Beach Date: Sun, 15 Oct 2017 22:08:52 +0100 Subject: [PATCH] Revert "Debugging" This reverts commit 991631c --- .../discourse_donations/charges_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/discourse_donations/charges_controller.rb b/app/controllers/discourse_donations/charges_controller.rb index 6cb8331..72be0e0 100644 --- a/app/controllers/discourse_donations/charges_controller.rb +++ b/app/controllers/discourse_donations/charges_controller.rb @@ -4,14 +4,14 @@ module DiscourseDonations class ChargesController < ActionController::Base include CurrentUser + protect_from_forgery prepend: true + protect_from_forgery with: :exception + skip_before_action :verify_authenticity_token, only: [:create] def create output = { 'messages' => [], 'rewards' => [] } - debug(params) - debug(user_params) - if create_account if !email.present? || !user_params[:username].present? output['messages'] << I18n.t('login.missing_user_field') @@ -36,8 +36,8 @@ module DiscourseDonations err = e.json_body[:error] output['messages'] << "There was an error (#{err[:type]})." - output['messages'] << "Error code: #{err[:code]}" if err[:code] - output['messages'] << "Decline code: #{err[:decline_code]}" if err[:decline_code] + #output['messages'] << "Error code: #{err[:code]}" if err[:code] + #output['messages'] << "Decline code: #{err[:decline_code]}" if err[:decline_code] output['messages'] << "Message: #{err[:message]}" if err[:message] render(:json => output) and return