Skip to content

Commit

Permalink
Fixed current state logged in check in logout.
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhenry committed Jul 26, 2015
1 parent 65462be commit b8d7b66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/app/_partials/navigation/navigation.ts
Expand Up @@ -45,8 +45,8 @@ module app.partials.navigation{
$scope.promptLogin = () => ngJwtAuthService.promptLogin();
$scope.logout = () => {
ngJwtAuthService.logout();
let currentState:global.IState = <global.IState>this.$state.get();
if (currentState.data.loggedIn) {
let currentState:global.IState = <global.IState>this.$state.current;
if (currentState.name && currentState.data.loggedIn) {
this.$state.go('app.guest.home'); //go back to the homepage if we are currently in a logged in state
}
}
Expand Down

0 comments on commit b8d7b66

Please sign in to comment.