From 4bf78ffe49c50fc4f005d5bfd008d8617fe1f0ef Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 25 Jun 2014 16:52:20 -0400 Subject: [PATCH] login / authtoken repairs Signed-off-by: Bill Erickson --- Open-ILS/web/js/ui/default/staff/app.js | 11 ++++------- Open-ILS/web/js/ui/default/staff/services/navbar.js | 13 +++++-------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/app.js b/Open-ILS/web/js/ui/default/staff/app.js index 1c73cf358f..5c155a90b2 100644 --- a/Open-ILS/web/js/ui/default/staff/app.js +++ b/Open-ILS/web/js/ui/default/staff/app.js @@ -21,13 +21,7 @@ function($routeProvider , $locationProvider) { $routeProvider.when('/login', { templateUrl: './t_login', controller: 'LoginCtrl', - resolve : {delay : ['egCore', function(egCore) { - // hack for now to kill the base ses cookie where sub-path - // apps were unable to remove it. See note at the top of - // services/auth.js about angular cookies and paths. - egCore.auth.logout(); - return egCore.startup.go(); - }]} + resolve : resolver }); // default page @@ -50,6 +44,9 @@ function($routeProvider , $locationProvider) { function($scope , $location , $window , egCore) { $scope.focusMe = true; + // if the user is already logged in, jump to splash page + if (egCore.auth.user()) $location.path('/'); + egCore.hatch.getItem('eg.workstation.all') .then(function(all) { if (all && all.length) { diff --git a/Open-ILS/web/js/ui/default/staff/services/navbar.js b/Open-ILS/web/js/ui/default/staff/services/navbar.js index ed017af55a..8806d65bed 100644 --- a/Open-ILS/web/js/ui/default/staff/services/navbar.js +++ b/Open-ILS/web/js/ui/default/staff/services/navbar.js @@ -64,17 +64,14 @@ angular.module('egCoreMod') return true; }; - // display the username and workstation after startup completes - if ($location.path() != '/login') { - // avoiding rending user info on the login page - - egCore.startup.go().then( - function() { + egCore.startup.go().then( + function() { + if (egCore.auth.user()) { $scope.username = egCore.auth.user().usrname(); $scope.workstation = egCore.auth.workstation(); } - ); - } + } + ); } ] } -- 2.11.0