diff options
author | Emmanuel ROHEE <erohee@amdocs.com> | 2014-08-18 10:44:29 +0200 |
---|---|---|
committer | Emmanuel ROHEE <erohee@amdocs.com> | 2014-08-18 10:44:29 +0200 |
commit | 0b5674ccc5e636249f0bf746a81af814dc4c8700 (patch) | |
tree | 070929e13043f223e05280fb493b5305f5b54a72 /webclient/components | |
parent | Added another button to upload and send an image. (diff) | |
download | synapse-0b5674ccc5e636249f0bf746a81af814dc4c8700.tar.xz |
Do not start the event stream if the user is not logged in (=if he does not has an access token yet)
Add isUserLoggedIn to check this.
Diffstat (limited to 'webclient/components')
-rw-r--r-- | webclient/components/matrix/matrix-service.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/webclient/components/matrix/matrix-service.js b/webclient/components/matrix/matrix-service.js index 0cc85db28e..c52c94c310 100644 --- a/webclient/components/matrix/matrix-service.js +++ b/webclient/components/matrix/matrix-service.js @@ -318,12 +318,21 @@ angular.module('matrixService', []) }; return doRequest("GET", path, params); }, - - // - testLogin: function() { - + + // Indicates if user authentications details are stored in cache + isUserLoggedIn: function() { + var config = this.config(); + + // User is considered logged in if his cache is not empty and contains + // an access token + if (config && config.access_token) { + return true; + } + else { + return false; + } }, - + /****** Permanent storage of user information ******/ // Returns the current config |