Redirect to the login page if auth failure has no origin
authorTom Hughes <tom@compton.nu>
Thu, 16 Apr 2015 10:16:18 +0000 (11:16 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 16 Apr 2015 10:16:18 +0000 (11:16 +0100)
app/controllers/user_controller.rb

index fcd330ec34abf5b7e2eca0d3d6d453bd4f5be40a..3a0e0a14935c4fc5ae270610568f250be3820310 100644 (file)
@@ -545,7 +545,7 @@ class UserController < ApplicationController
   # omniauth failure callback
   def auth_failure
     flash[:error] = t("user.auth_failure." + params[:message])
-    redirect_to params[:origin]
+    redirect_to params[:origin] || login_url
   end
 
   private