Only store the preAuthUrl if the user is trying to navigate to a non-login/logout state

This commit is contained in:
Michael Abashian 2017-06-08 19:19:33 -04:00
parent 7768106d3f
commit cfc15dab37

View File

@ -364,7 +364,9 @@ var tower = angular.module('Tower', [
if (!Authorization.getToken() || !Authorization.isUserLoggedIn()) {
// User not authenticated, redirect to login page
$cookies.put('preAuthUrl', $location.path());
if (!/^\/(login|logout)/.test($location.path())) {
$cookies.put('preAuthUrl', $location.path());
}
$location.path('/login');
} else {
var lastUser = $cookies.getObject('current_user'),