summaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2017-11-30 17:40:34 +0100
committerAndrej Mihajlov <and@mullvad.net>2017-12-06 13:36:25 +0100
commit409e322de1457724916da56171c8a72691e783b5 (patch)
tree14466c2d8e39663749856713bec250c3162fbd22 /app
parentac0d45e28b13f963c85dc721ddc29c8b6b27a536 (diff)
downloadmullvadvpn-409e322de1457724916da56171c8a72691e783b5.tar.xz
mullvadvpn-409e322de1457724916da56171c8a72691e783b5.zip
Convert Backend._authenticate() to async
Diffstat (limited to 'app')
-rw-r--r--app/lib/backend.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js
index 3eb0614664..8a3b8d16d0 100644
--- a/app/lib/backend.js
+++ b/app/lib/backend.js
@@ -450,14 +450,13 @@ export class Backend {
}
}
- _authenticate(sharedSecret: string): Promise<void> {
- return this._ipc.authenticate(sharedSecret)
- .then(() => {
- log.info('Authenticated with backend');
- })
- .catch((e) => {
- log.error('Failed to authenticate with backend: ', e.message);
- throw e;
- });
+ async _authenticate(sharedSecret: string): Promise<void> {
+ try {
+ await this._ipc.authenticate(sharedSecret);
+ log.info('Authenticated with backend');
+ } catch (e) {
+ log.error('Failed to authenticate with backend: ', e.message);
+ throw e;
+ }
}
}