From 7143f358f1487d4044cc5ad64056f621a5aa2139 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 14 Aug 2014 14:59:33 +0200 Subject: Detect when the user access token is no more valid and log the user out in this case --- webclient/app-controller.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'webclient/app-controller.js') diff --git a/webclient/app-controller.js b/webclient/app-controller.js index 41055bdcd2..086fa3d946 100644 --- a/webclient/app-controller.js +++ b/webclient/app-controller.js @@ -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(); + }); }]); \ No newline at end of file -- cgit 1.4.1