Detect when the user access token is no more valid and log the user out in this case

This commit is contained in:
Emmanuel ROHEE 2014-08-14 14:59:33 +02:00
parent 613e468b89
commit 7143f358f1
2 changed files with 20 additions and 4 deletions

View file

@ -55,8 +55,14 @@ angular.module('MatrixWebClientController', ['matrixService'])
// And go to the login page
$location.path("login");
};
};
// Listen to the event indicating that the access token is no more valid.
// In this case, the user needs to log in again.
$scope.$on("M_UNKNOWN_TOKEN", function() {
console.log("Invalid access token -> log user out");
$scope.logout();
});
}]);