summaryrefslogtreecommitdiff
path: root/www/app/models/dummy_account.js
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-09-05 17:34:11 -0700
committerKali Kaneko (leap communications) <kali@leap.se>2016-09-06 13:55:16 -0400
commit65c2c18653feb5f6485710e9656b19e368bb2826 (patch)
treea279d6f4eb502b30606870cd34af2896eef7321d /www/app/models/dummy_account.js
parentb047beb3e50a541564d2ab6ff17491608a630101 (diff)
[feature] webkit support: get the js and css working in older webkit engines
Diffstat (limited to 'www/app/models/dummy_account.js')
-rw-r--r--www/app/models/dummy_account.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/www/app/models/dummy_account.js b/www/app/models/dummy_account.js
new file mode 100644
index 00000000..bf0391be
--- /dev/null
+++ b/www/app/models/dummy_account.js
@@ -0,0 +1,33 @@
+//
+// A proxy of an account, but with a different ID. For testing.
+//
+
+import bitmask from 'lib/bitmask'
+
+export default class DummyAccount {
+
+ constructor(account) {
+ this.account = account
+ }
+
+ get id() {
+ return 'dummy--' + this.account.address
+ }
+
+ get domain() {return this.account.domain}
+ get address() {return this.account.address}
+ get userpart() {return this.account.userpart}
+ get authenticated() {return this.account.authenticated}
+ get hasEmail() {return this.account.hasEmail}
+ login(password) {return this.account.login(password)}
+
+ logout() {
+ return bitmask.user.logout(this.address).then(
+ response => {
+ this._authenticated = false
+ this._address = '@' + this.domain
+ return this
+ }
+ )
+ }
+}