fixed sign out function

This commit is contained in:
Jon Lambson 2017-08-21 11:55:11 -06:00
parent 47243870e2
commit 198597dc3b
2 changed files with 12 additions and 11 deletions

View File

@ -123,9 +123,9 @@ app.controller('loginCtrl', [
vm.newIssuer = vm.defaultIssuer; vm.newIssuer = vm.defaultIssuer;
vm.setIssuer(vm.defaultIssuer); vm.setIssuer(vm.defaultIssuer);
vm.initGetSession = function() { vm.getSession = function() {
return Auth.select(Auth.session); return Auth.select(Auth.session);
} };
vm.initListLoggedInProfiles = function () { vm.initListLoggedInProfiles = function () {
vm.activeProfiles = Auth.getActiveSessions(); vm.activeProfiles = Auth.getActiveSessions();
@ -141,14 +141,15 @@ app.controller('loginCtrl', [
}; };
vm.signOut = function () { vm.signOut = function () {
vm.getSession().then(function(){
// TODO the sign-out url for each account should be fixed. // TODO the sign-out url for each account should be fixed.
return Auth.signOut().then(function () { return Auth.signOut().then(function () {
if (Auth.sessions.length === 0) { if (Auth.sessions.length === 0) {
$location.path('/splash-page'); $location.path('/splash-page');
return; return;
} }
window.alert("You are still logged in with other accounts."); window.alert("You are still logged in with other accounts.");
});
}); });
}; };

View File

@ -1,4 +1,4 @@
<nav class="navbar navbar-default navbar-fixed-top" ng-init="vm.initGetSession()"> <nav class="navbar navbar-default navbar-fixed-top">
<div class="container"> <div class="container">
<div class="navbar-header"> <div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">