server/api: refactor + remove ID from user JSON

This commit is contained in:
rr-
2016-04-16 15:07:33 +02:00
parent adecdd4cd9
commit e4239a199c
23 changed files with 482 additions and 560 deletions

View File

@ -140,8 +140,13 @@ class Api {
cookies.remove('auth');
}
isLoggedIn() {
return this.userName !== null;
isLoggedIn(user) {
if (user) {
return this.userName !== null &&
this.userName.toLowerCase() === user.name.toLowerCase();
} else {
return this.userName !== null;
}
}
getFullUrl(url) {