From 198597dc3b4ee0f7487f1567350b9f26102b0c46 Mon Sep 17 00:00:00 2001 From: Jon Lambson Date: Mon, 21 Aug 2017 11:55:11 -0600 Subject: [PATCH] fixed sign out function --- js/controllers/login-controller.js | 21 +++++++++++---------- templates/partials/header.html | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/js/controllers/login-controller.js b/js/controllers/login-controller.js index 6e32e47..18012b1 100644 --- a/js/controllers/login-controller.js +++ b/js/controllers/login-controller.js @@ -123,9 +123,9 @@ app.controller('loginCtrl', [ vm.newIssuer = vm.defaultIssuer; vm.setIssuer(vm.defaultIssuer); - vm.initGetSession = function() { + vm.getSession = function() { return Auth.select(Auth.session); - } + }; vm.initListLoggedInProfiles = function () { vm.activeProfiles = Auth.getActiveSessions(); @@ -141,14 +141,15 @@ app.controller('loginCtrl', [ }; vm.signOut = function () { - - // TODO the sign-out url for each account should be fixed. - return Auth.signOut().then(function () { - if (Auth.sessions.length === 0) { - $location.path('/splash-page'); - return; - } - window.alert("You are still logged in with other accounts."); + vm.getSession().then(function(){ + // TODO the sign-out url for each account should be fixed. + return Auth.signOut().then(function () { + if (Auth.sessions.length === 0) { + $location.path('/splash-page'); + return; + } + window.alert("You are still logged in with other accounts."); + }); }); }; diff --git a/templates/partials/header.html b/templates/partials/header.html index 4033d13..fb4afac 100644 --- a/templates/partials/header.html +++ b/templates/partials/header.html @@ -1,4 +1,4 @@ -