diff --git a/src/Umbraco.Web.UI.Client/src/common/services/events.service.js b/src/Umbraco.Web.UI.Client/src/common/services/events.service.js index f90936f371..965ac3d635 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/events.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/events.service.js @@ -18,8 +18,6 @@ function eventsService($q, $rootScope) { /** raise an event with a given name */ emit: function (name, args) { - console.log(`Emitting event: ${name}`, args); - //there are no listeners if (!$rootScope.$$listeners[name]) { return; diff --git a/src/Umbraco.Web.UI.Client/src/init.js b/src/Umbraco.Web.UI.Client/src/init.js index f46b24a546..c5a20cd890 100644 --- a/src/Umbraco.Web.UI.Client/src/init.js +++ b/src/Umbraco.Web.UI.Client/src/init.js @@ -23,6 +23,7 @@ app.run(['$rootScope', '$route', '$location', 'urlHelper', 'navigationService', if(user.startContentIds.length === 0 && user.startMediaIds.length === 0){ const args = { isTimedOut: true, noAccess: true }; eventsService.emit("app.notAuthenticated", args); + return; } assetsService._loadInitAssets().then(function () { diff --git a/src/Umbraco.Web.UI.Client/src/main.controller.js b/src/Umbraco.Web.UI.Client/src/main.controller.js index 4fac328f70..54d897ca74 100644 --- a/src/Umbraco.Web.UI.Client/src/main.controller.js +++ b/src/Umbraco.Web.UI.Client/src/main.controller.js @@ -56,9 +56,11 @@ function MainController($scope, $location, appState, treeService, notificationsS appState.setSearchState("show", false); }; - $scope.showLoginScreen = function(isTimedOut) { - console.log('SHOW ME THE LOGIN SCREEN'); + $scope.showLoginScreen = function(isTimedOut, noAccess) { + console.log('SHOW ME THE LOGIN SCREEN', isTimedOut, noAccess); + $scope.login.isTimedOut = isTimedOut; + $scope.login.noAccess = noAccess; $scope.login.show = true; }; @@ -73,10 +75,9 @@ function MainController($scope, $location, appState, treeService, notificationsS $scope.authenticated = null; $scope.user = null; const isTimedOut = data && data.isTimedOut ? true : false; + const noAccess = data && data.noAccess ? true : false; - console.log('Log me out & show login screen?', isTimedOut); - - $scope.showLoginScreen(isTimedOut); + $scope.showLoginScreen(isTimedOut, noAccess); // Remove the localstorage items for tours shown // Means that when next logged in they can be re-shown if not already dismissed etc diff --git a/src/Umbraco.Web.UI.Client/src/views/common/login.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/login.controller.js index 713af9661b..86132fe8f3 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/login.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/login.controller.js @@ -17,13 +17,6 @@ angular.module('umbraco').controller("Umbraco.LoginController", function (events $location.url(path); }); - eventsService.on("app.notAuthenticated", function(evt, data){ - console.log('not authenticated event back', data); - if(data.noAccess){ - alert('NO NO NO YOU HAVE NO START NODES'); - } - }); - $scope.$on('$destroy', function () { eventsService.unsubscribe(evtOn); }); diff --git a/src/Umbraco.Web.UI.Client/src/views/components/application/umb-login.html b/src/Umbraco.Web.UI.Client/src/views/components/application/umb-login.html index 2e81395643..c26e3daa8a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/application/umb-login.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/application/umb-login.html @@ -120,7 +120,8 @@

- Log in below. + Session timed out. + User has no start-nodes.