diff options
Diffstat (limited to 'gui/src/main')
| -rw-r--r-- | gui/src/main/daemon-rpc.ts | 9 | ||||
| -rw-r--r-- | gui/src/main/index.ts | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts index 1ce4450af3..6105f75c56 100644 --- a/gui/src/main/daemon-rpc.ts +++ b/gui/src/main/daemon-rpc.ts @@ -428,6 +428,15 @@ export class DaemonRpc { } } + public async getWwwAuthToken(): Promise<string> { + const response = await this.transport.send('get_www_auth_token'); + try { + return validate(string, response); + } catch (error) { + throw new ResponseParseError('Invalid response from get_www_auth_token', error); + } + } + public async getRelayLocations(): Promise<IRelayList> { const response = await this.transport.send('get_relay_locations'); try { diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 5b5c58d108..9397d45467 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -991,6 +991,7 @@ class ApplicationMain { IpcMainEventChannel.account.handleLogin((token: AccountToken) => this.login(token)); IpcMainEventChannel.account.handleLogout(() => this.logout()); + IpcMainEventChannel.account.handleWwwAuthToken(() => this.daemonRpc.getWwwAuthToken()); IpcMainEventChannel.accountHistory.handleRemoveItem(async (token: AccountToken) => { await this.daemonRpc.removeAccountFromHistory(token); |
