summaryrefslogtreecommitdiff
path: root/client/js/api.js
diff options
context:
space:
mode:
authorrr- <rr-@sakuya.pl>2016-04-16 15:07:33 +0200
committerrr- <rr-@sakuya.pl>2016-04-16 15:49:21 +0200
commite4239a199ccd4ceb2747d195ed41a3e66c6f9f6c (patch)
tree0dfa44767c3e5a88d4539c9c6ff09f275769087b /client/js/api.js
parentadecdd4cd96d0257cf3eab40ac09becc986e7724 (diff)
server/api: refactor + remove ID from user JSON
Diffstat (limited to 'client/js/api.js')
-rw-r--r--client/js/api.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/js/api.js b/client/js/api.js
index 0e20058..cb16608 100644
--- a/client/js/api.js
+++ b/client/js/api.js
@@ -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) {