{"action":"opened","issue":{"url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-js/issues/316","repository_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-js","labels_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-js/issues/316/labels{/name}","comments_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-js/issues/316/comments","events_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-js/issues/316/events","html_url":"https://github.com/AzureAD/azure-activedirectory-library-for-js/issues/316","id":161580394,"number":316,"title":"Routing continues to page even after being directed to login","user":{"login":"Neil665","id":19176828,"avatar_url":"https://avatars.githubusercontent.com/u/19176828?v=3","gravatar_id":"","url":"https://api.github.com/users/Neil665","html_url":"https://github.com/Neil665","followers_url":"https://api.github.com/users/Neil665/followers","following_url":"https://api.github.com/users/Neil665/following{/other_user}","gists_url":"https://api.github.com/users/Neil665/gists{/gist_id}","starred_url":"https://api.github.com/users/Neil665/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Neil665/subscriptions","organizations_url":"https://api.github.com/users/Neil665/orgs","repos_url":"https://api.github.com/users/Neil665/repos","events_url":"https://api.github.com/users/Neil665/events{/privacy}","received_events_url":"https://api.github.com/users/Neil665/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-22T02:23:14Z","updated_at":"2016-06-22T02:23:14Z","closed_at":null,"body":"When adal-angular.js handles routing to a secured page, it passes control off to the loginHandler method, but as currently implemented it also lets the navigation to that page continue at the same time. This means that the page starts to get loaded when the user is not yet logged in. It seems to me that the preventDefault mechanism should be used by adding a single line as indicated below.\r\n\r\nIs this correct?\r\n\r\n```javascript\r\n                var routeChangeHandler = function (e, nextRoute) {\r\n                    if (nextRoute && nextRoute.$$route) {\r\n                        if (isADLoginRequired(nextRoute.$$route, _adal.config)) {\r\n                            if (!_oauthData.isAuthenticated && !_adal._renewActive) {\r\n                                _adal.info('Route change event for:' + $location.$$url);\r\n                                e.preventDefault(); // *** ADDED LINE ***\r\n                                loginHandler();\r\n                            }\r\n                        }\r\n                        else {\r\n                            if (nextRoute.$$route.templateUrl && !isAnonymousEndpoint(nextRoute.$$route.templateUrl)) {\r\n                                _adal.config.anonymousEndpoints.push(nextRoute.$$route.templateUrl);\r\n                            }\r\n                        }\r\n                    }\r\n                };\r\n```"}}
{"actor":{"display_login":"Neil665"}}