]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Merge remote-tracking branch 'upstream/pull/3192'
[rails.git] / app / controllers / application_controller.rb
index 586b181165941e2fb887bbe6ff1b6ab2e2b5f4dc..d571535d356ef4db7646df3b618c816b2b6f4574 100644 (file)
@@ -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