]> git.openstreetmap.org Git - rails.git/commitdiff
Specify the controller when redirecting a failed login
authorTom Hughes <tom@compton.nu>
Sun, 24 Oct 2021 09:38:35 +0000 (10:38 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 24 Oct 2021 09:38:35 +0000 (10:38 +0100)
This ensures that third party logins, whose callback is processed
by the users controller, go to the right place.

app/controllers/concerns/session_methods.rb

index dd6458b1b9359aa42ed4b5bce4cc6a5df0b9a269..eb24f6b2089afef5c41372458c81345b450540ec 100644 (file)
@@ -69,7 +69,7 @@ module SessionMethods
   def failed_login(message, username = nil)
     flash[:error] = message
 
-    redirect_to :action => "new", :referer => session[:referer],
+    redirect_to :controller => "sessions", :action => "new", :referer => session[:referer],
                 :username => username, :remember_me => session[:remember_me]
 
     session.delete(:remember_me)