diff options
author | elijah <elijah@riseup.net> | 2016-09-21 15:39:03 -0700 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2016-09-22 11:40:14 -0400 |
commit | 7569ac8bd58174095f3f897548e26d0ba905236c (patch) | |
tree | 839c300d7dff62900bcc91672a3b55cf62c31f6c /ui/app/models/account.js | |
parent | 61b5734c12d6ab6733d3a832df8d99f1041bf355 (diff) |
[feat] the setup wizard for the new ui
Diffstat (limited to 'ui/app/models/account.js')
-rw-r--r-- | ui/app/models/account.js | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/ui/app/models/account.js b/ui/app/models/account.js index 52fea93d..726a8b8c 100644 --- a/ui/app/models/account.js +++ b/ui/app/models/account.js @@ -57,6 +57,11 @@ export default class Account { return bitmask.bonafide.user.auth(this.address, password).then( response => { if (response.uuid) { + // currently, only one account can be authenticated at once + Account.list.forEach(account => { + account._authenticated = false + // if(account.id != this.id) {account.logout()} + }) this._uuid = response.uuid this._authenticated = true } @@ -131,13 +136,15 @@ export default class Account { return i.id != account.id }) } - // return Account.list - // return new Promise(function(resolve, reject) { - // window.setTimeout(function() { - // resolve(['@blah', '@lala']) - // }, 1000) - // }) - // } + + static create(address, password) { + return bitmask.bonafide.user.create(address, password).then( + response => { + console.log(response) + return new Account(address) + } + ) + } } Account.list = [] |