diff options
| author | rr- <rr-@sakuya.pl> | 2016-04-16 15:07:33 +0200 |
|---|---|---|
| committer | rr- <rr-@sakuya.pl> | 2016-04-16 15:49:21 +0200 |
| commit | e4239a199ccd4ceb2747d195ed41a3e66c6f9f6c (patch) | |
| tree | 0dfa44767c3e5a88d4539c9c6ff09f275769087b /client/js/api.js | |
| parent | adecdd4cd96d0257cf3eab40ac09becc986e7724 (diff) | |
server/api: refactor + remove ID from user JSON
Diffstat (limited to 'client/js/api.js')
| -rw-r--r-- | client/js/api.js | 9 |
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) { |