From ec9f767ee60e040e5ab2e886fa3762781820c05f Mon Sep 17 00:00:00 2001 From: Sem van Nieuwenhuizen Date: Thu, 26 Dec 2024 14:30:51 +0100 Subject: [PATCH] fix: pass stirng to `redirect_to` funciton --- app/controllers/members/payments_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/members/payments_controller.rb b/app/controllers/members/payments_controller.rb index 05cdfbf03..3c80ae4d7 100644 --- a/app/controllers/members/payments_controller.rb +++ b/app/controllers/members/payments_controller.rb @@ -45,6 +45,7 @@ def pay_activities transaction_type: :activity, redirect_uri: member_payments_path ) + if payment.save # Check URI for safety (supresses brakeman warning) url = begin @@ -55,7 +56,7 @@ def pay_activities # Check if it's a valid URI and matches your whitelist of acceptable domains (e.g., only http(s)://example.com) if url.is_a?(URI::HTTP) && ['mollie.com'].include?(url.host) - redirect_to(url) + redirect_to(url.to_s) else # Fallback to a safe default redirect if the URI is invalid or not in the whitelist redirect_to(root_path)