From 6dc0bd9156cbdc41f262b7b5657bba7c3aa39240 Mon Sep 17 00:00:00 2001 From: vacabor <166112501+vacabor@users.noreply.github.com> Date: Tue, 1 Oct 2024 16:43:19 +0100 Subject: [PATCH] Clear the employee-email slug on form failure so it is not bypassed --- app/controllers/claims_form_callbacks.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/claims_form_callbacks.rb b/app/controllers/claims_form_callbacks.rb index 49ac10bdb6..3dacfdd5c2 100644 --- a/app/controllers/claims_form_callbacks.rb +++ b/app/controllers/claims_form_callbacks.rb @@ -73,6 +73,11 @@ def check_your_answers_after_form_save_success create_and_save_claim_form end + def employee_email_after_form_save_failure + session[:slugs].delete("employee-email") + render_template_for_current_slug + end + private def set_backlink_override_to_current_slug