summaryrefslogtreecommitdiff
path: root/ui/app/models
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-12-26 18:25:58 -0800
committerKali Kaneko (leap communications) <kali@leap.se>2016-12-29 03:10:03 +0100
commit38fc7da2a9cff329c3b4975d9f01c16c10b572e9 (patch)
tree90acbc081a959eafac71c64c8cbb483d5b1d1b3c /ui/app/models
parent3461fb49985413bb578af511bf0d13efbc25b5b6 (diff)
[feature] add support for authenticated API to bitmask.js
Diffstat (limited to 'ui/app/models')
-rw-r--r--ui/app/models/account.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/app/models/account.js b/ui/app/models/account.js
index e93d757..0251da0 100644
--- a/ui/app/models/account.js
+++ b/ui/app/models/account.js
@@ -112,6 +112,9 @@ export default class Account {
// returns a promise, fullfill is passed account object
//
static active() {
+ if (!bitmask.api_token()) {
+ return new Promise((resolve, reject) => {resolve(null)})
+ }
return bitmask.bonafide.user.active().then(
response => {
if (response.user == '<none>') {