summaryrefslogtreecommitdiffhomepage
path: root/app/lib
diff options
context:
space:
mode:
authorErik Larkö <erik@mullvad.net>2017-07-04 13:12:18 +0200
committerErik Larkö <erik@mullvad.net>2017-07-05 17:02:17 +0200
commit91e50b1c4eaec737944cb9d56d6d2e99749edcdd (patch)
tree13da723f884618c570f5dc1d115a3b47e42306f9 /app/lib
parent2abc1f10caf3862e8b1cbc7ebdeef545c90d4a26 (diff)
downloadmullvadvpn-91e50b1c4eaec737944cb9d56d6d2e99749edcdd.tar.xz
mullvadvpn-91e50b1c4eaec737944cb9d56d6d2e99749edcdd.zip
Logout tests
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/backend.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js
index a4487f56a6..b4ac1c2574 100644
--- a/app/lib/backend.js
+++ b/app/lib/backend.js
@@ -198,8 +198,17 @@ export class Backend {
// emit event
this._emit('logout');
+ this._store.dispatch(accountActions.loginChange({
+ status: 'none',
+ accountNumber: null,
+ paidUntil: null,
+ }));
+
// disconnect user during logout
- return this.disconnect();
+ return this.disconnect()
+ .then( () => {
+ this._store.dispatch(push('/'));
+ });
})
.catch(e => {
log.info('Failed to logout', e);
@@ -238,9 +247,9 @@ export class Backend {
});
}
- disconnect() {
+ disconnect(): Promise<void> {
// @TODO: Failure modes
- this._ipc.disconnect()
+ return this._ipc.disconnect()
.then(() => {
// emit: disconnect
this._emit('disconnect');