1
0
mirror of https://github.com/bitwarden/directory-connector synced 2026-01-04 09:33:26 +00:00

stringify and parse json

This commit is contained in:
Kyle Spearrin
2019-03-16 00:38:41 -04:00
parent e51a70f7b9
commit 183b54f9b8

View File

@@ -10,13 +10,13 @@ export class KeytarSecureStorageService implements StorageService {
constructor(private serviceName: string) { }
get<T>(key: string): Promise<T> {
return getPassword(this.serviceName, key).then((val: any) => {
return val as T;
return getPassword(this.serviceName, key).then((val) => {
return JSON.parse(val) as T;
});
}
save(key: string, obj: any): Promise<any> {
return setPassword(this.serviceName, key, obj);
return setPassword(this.serviceName, key, JSON.stringify(obj));
}
remove(key: string): Promise<any> {