From 8cc42cb170a3ec763d32c7769e53fda34274cf1e Mon Sep 17 00:00:00 2001 From: Alex Sherman Date: Fri, 28 Feb 2020 13:54:56 +0500 Subject: [PATCH] Fix redirect back Closes #1535 --- app/controllers/admin/zonefiles_controller.rb | 2 +- app/controllers/registrar/current_user_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/zonefiles_controller.rb b/app/controllers/admin/zonefiles_controller.rb index 30b4b9a61..4fd84bb77 100644 --- a/app/controllers/admin/zonefiles_controller.rb +++ b/app/controllers/admin/zonefiles_controller.rb @@ -13,7 +13,7 @@ module Admin send_data @zonefile, filename: "#{params[:origin]}.txt" else flash[:alert] = 'Origin not supported' - redirect_to :back + redirect_back(fallback_location: root_path) end end end diff --git a/app/controllers/registrar/current_user_controller.rb b/app/controllers/registrar/current_user_controller.rb index 624ee294e..3a214322c 100644 --- a/app/controllers/registrar/current_user_controller.rb +++ b/app/controllers/registrar/current_user_controller.rb @@ -6,7 +6,7 @@ class Registrar raise 'Cannot switch to unlinked user' unless current_registrar_user.linked_with?(new_user) sign_in(:registrar_user, new_user) - redirect_to :back, notice: t('.switched', new_user: new_user) + redirect_back(fallback_location: root_path, notice: t('.switched', new_user: new_user)) end private