From 2db27ff15beed0de99aeb3522ed9c877c05a7aa6 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Sat, 18 Oct 2014 19:43:54 -0400 Subject: [PATCH] fixed homepage redirect loop? --- app/controllers/application_controller.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bcaa16d4..437ffcad 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -34,8 +34,11 @@ private def require_user unless authenticated? - unless request.env["REQUEST_URI"] == root_url - store_location_for(:user, request.env["PATH_INFO"]) and redirect_to root_url + + path = request.env["PATH_INFO"] + + unless path == "/" || path == new_user_registration_path || path == new_user_session_path + store_location_for(:user, path) and redirect_to root_url return false end end