From fe4aa3f0b3008565944432932b8c87199f9a8f4c Mon Sep 17 00:00:00 2001 From: Stas Date: Mon, 7 Mar 2016 13:53:13 +0200 Subject: [PATCH] 105842700-method_for_verification_url --- app/controllers/registrant/domains_controller.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/controllers/registrant/domains_controller.rb b/app/controllers/registrant/domains_controller.rb index 14a961aba..18c29abb0 100644 --- a/app/controllers/registrant/domains_controller.rb +++ b/app/controllers/registrant/domains_controller.rb @@ -26,7 +26,7 @@ class Registrant::DomainsController < RegistrantController dom.pending_json.present? @domain = dom - confirm_path = "#{ENV['registrant_url']}/registrant/domain_update_confirms" + confirm_path = get_confirm_path(dom.statuses) @verification_url = "#{confirm_path}/#{@domain.id}?token=#{@domain.registrant_verification_token}" else @@ -74,4 +74,13 @@ class Registrant::DomainsController < RegistrantController yield params[:q][:valid_to_lteq] = ca_cache end + + def get_confirm_path(statuses) + if statuses.include?(DomainStatus::PENDING_UPDATE) + "#{ENV['registrant_url']}/registrant/domain_update_confirms" + elsif statuses.include?(DomainStatus::PENDING_DELETE) + "#{ENV['registrant_url']}/registrant/domain_delete_confirms" + end + end + end \ No newline at end of file