X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1eb1335bb2b8f8a545c6a267d7cca81508197db8..cb86e74f69c6b1fe62b06d037396976fadfa3ad8:/app/controllers/application_controller.rb?ds=sidebyside diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 586b18116..d571535d3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -59,7 +59,7 @@ class ApplicationController < ActionController::Base def require_user unless current_user if request.get? - redirect_to :controller => "users", :action => "login", :referer => request.fullpath + redirect_to login_path(:referer => request.fullpath) else head :forbidden end @@ -356,7 +356,7 @@ class ApplicationController < ActionController::Base end elsif request.get? respond_to do |format| - format.html { redirect_to :controller => "users", :action => "login", :referer => request.fullpath } + format.html { redirect_to login_path(:referer => request.fullpath) } format.any { head :forbidden } end else @@ -393,6 +393,8 @@ class ApplicationController < ActionController::Base referer = nil end + referer = nil if referer&.path&.first != "/" + referer.to_s end end