diff --git a/app/assets/javascripts/darkswarm/controllers/authentication/login_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/authentication/login_controller.js.coffee index c24f7a70f2..144cf0dfef 100644 --- a/app/assets/javascripts/darkswarm/controllers/authentication/login_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/authentication/login_controller.js.coffee @@ -1,13 +1,13 @@ -Darkswarm.controller "LoginCtrl", ($scope, $http, AuthenticationService, Redirections, Loading) -> +Darkswarm.controller "LoginCtrl", ($scope, $http, $window, AuthenticationService, Redirections, Loading) -> $scope.path = "/login" $scope.submit = -> Loading.message = "Hold on a moment, we're logging you in" $http.post("/user/spree_user/sign_in", {spree_user: $scope.spree_user}).success (data)-> if Redirections.after_login - location.href = location.origin + Redirections.after_login + $window.location.href = $window.location.origin + Redirections.after_login else - location.href = location.origin + location.pathname # Strips out hash fragments + $window.location.href = $window.location.origin + $window.location.pathname # Strips out hash fragments .error (data) -> Loading.clear() $scope.errors = data.message