Skip to content

Commit 449f104

Browse files
author
Nils Hanff
committed
Add platform secret functions to ElectronPlatform
Signed-off-by: Nils Hanff <[email protected]>
1 parent d072737 commit 449f104

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/vector/platform/ElectronPlatform.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,24 @@ export default class ElectronPlatform extends VectorBasePlatform {
403403
return true;
404404
}
405405

406+
public async getPlatformSecret(key: string): Promise<string | null> {
407+
return await this.ipc.call("getSecret", key).catch((error) => {
408+
logger.info(`Failed to connect to password storage to get ${key}`, error);
409+
});
410+
}
411+
412+
public async savePlatformSecret(key: string, value: string): Promise<string | null> {
413+
return await this.ipc.call("saveSecret", key, value).catch((error) => {
414+
logger.info(`Failed to connect to password storage to save ${key}`, error);
415+
});
416+
}
417+
418+
public async destroyPlatformSecret(key: string): Promise<void> {
419+
return await this.ipc.call("destroySecret", key).catch((error) => {
420+
logger.info(`Failed to connect to password storage to destroy ${key}`, error);
421+
});
422+
}
423+
406424
public async getPickleKey(userId: string, deviceId: string): Promise<string | null> {
407425
try {
408426
return await this.ipc.call("getPickleKey", userId, deviceId);

0 commit comments

Comments
 (0)