Fixes U4-5213 in a better way using a query string so it's clear where it redirects to

This commit is contained in:
Shannon
2015-05-07 09:11:25 +10:00
parent 6e7aa19073
commit 3ce5ff882e

View File

@@ -46,10 +46,17 @@ app.run(['userService', '$log', '$rootScope', '$location', 'navigationService',
$rootScope.$on('$routeChangeError', function(event, current, previous, rejection) {
event.preventDefault();
//Set the current path before redirecting so we know where to redirect back to
var returnPath = encodeURIComponent($location.url());
var returnPath = null;
if (rejection.path == "/login" || rejection.path.startsWith("/login/")) {
//Set the current path before redirecting so we know where to redirect back to
returnPath = encodeURIComponent($location.url());
}
$location.path(rejection.path).search("returnPath", returnPath);
$location.path(rejection.path)
if (returnPath) {
$location.search("returnPath", returnPath);
}
});