From 1875c9682e03ef9e1c2d594e74890485e8d94089 Mon Sep 17 00:00:00 2001 From: kiswa Date: Sat, 1 Nov 2014 15:18:39 -0400 Subject: [PATCH] Redirect to boards when opening login if token exists. Fixes #25. --- js/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/app.js b/js/app.js index 4012ea4..6757d85 100644 --- a/js/app.js +++ b/js/app.js @@ -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) {