summary refs log tree commit diff
path: root/webclient/app-controller.js
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-08-14 14:59:33 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-08-14 15:00:21 +0200
commit7143f358f1487d4044cc5ad64056f621a5aa2139 (patch)
treed3387b1161691bbe7918ddca5d86bde88f7d9210 /webclient/app-controller.js
parentGuess the home server URL on the login screen by inspecting the URL of the we... (diff)
downloadsynapse-7143f358f1487d4044cc5ad64056f621a5aa2139.tar.xz
Detect when the user access token is no more valid and log the user out in this case
Diffstat (limited to 'webclient/app-controller.js')
-rw-r--r--webclient/app-controller.js10
1 files changed, 8 insertions, 2 deletions
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