Redirect to the login page if auth failure has no origin
[rails.git] / 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