summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer
diff options
context:
space:
mode:
authorEmīls Piņķis <emils@mullvad.net>2019-10-02 14:57:34 +0100
committerEmīls Piņķis <emils@mullvad.net>2019-10-07 12:35:22 +0100
commita8bd79e40c38e350b9838fa417b314ca7869836e (patch)
tree87fe68d7128a54268e8d609a5de394b42af4e338 /gui/src/renderer
parent47ed6dc64afc2693817cc2e84dc485b2650599d6 (diff)
downloadmullvadvpn-a8bd79e40c38e350b9838fa417b314ca7869836e.tar.xz
mullvadvpn-a8bd79e40c38e350b9838fa417b314ca7869836e.zip
Use authentication token in URLs
Diffstat (limited to 'gui/src/renderer')
-rw-r--r--gui/src/renderer/app.tsx12
1 files changed, 11 insertions, 1 deletions
diff --git a/gui/src/renderer/app.tsx b/gui/src/renderer/app.tsx
index f9c2390b25..ce7c00c55d 100644
--- a/gui/src/renderer/app.tsx
+++ b/gui/src/renderer/app.tsx
@@ -3,7 +3,7 @@ import {
push as pushHistory,
replace as replaceHistory,
} from 'connected-react-router';
-import { ipcRenderer, webFrame } from 'electron';
+import { ipcRenderer, shell, webFrame } from 'electron';
import log from 'electron-log';
import { createMemoryHistory } from 'history';
import * as React from 'react';
@@ -288,6 +288,16 @@ export default class AppRenderer {
return IpcRendererEventChannel.accountHistory.removeItem(accountToken);
}
+ public async openLinkWithAuth(link: string) {
+ let token;
+ try {
+ token = await IpcRendererEventChannel.account.getWwwAuthToken();
+ } catch (e) {
+ token = '';
+ }
+ shell.openExternal(`${link}?token=${token}`);
+ }
+
public async setAllowLan(allowLan: boolean) {
const actions = this.reduxActions;
await IpcRendererEventChannel.settings.setAllowLan(allowLan);