Redirect to boards when opening login if token exists. Fixes #25.

This commit is contained in:
kiswa 2014-11-01 15:18:39 -04:00
parent ec2fb800cb
commit 1875c9682e

View File

@ -62,6 +62,9 @@ function($rootScope, $location, $window, AuthenticationService) {
!$window.localStorage.token) {
$location.path('/');
}
if (nextRoute !== null && nextRoute.controller === 'LoginCtrl' && $window.localStorage.token) {
$location.path('/boards');
}
});
$rootScope.$on('$routeChangeSuccess', function(event, route, previousRoute) {