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.
This commit is contained in:
Emmanuel ROHEE 2014-08-18 10:44:29 +02:00
parent d5bebc9eaa
commit 0b5674ccc5
3 changed files with 17 additions and 9 deletions

View file

@ -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