1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

pack main and renderer

This commit is contained in:
Kyle Spearrin
2018-01-23 13:59:01 -05:00
parent 0a803958e9
commit 268ec9960e
10 changed files with 136 additions and 82 deletions

View File

@@ -0,0 +1,18 @@
import { getPassword, setPassword, deletePassword } from 'keytar';
import { StorageService } from 'jslib/abstractions';
export class DesktopSecureStorageService implements StorageService {
async get<T>(key: string): Promise<T> {
const val: string = await getPassword('bitwarden', key);
return val ? JSON.parse(val) as T : null
}
async save(key: string, obj: any): Promise<any> {
await setPassword('bitwarden', key, JSON.stringify(obj));
}
async remove(key: string): Promise<any> {
await deletePassword('bitwarden', key);
}
}