mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
[BEEEP] [EC-141] Rust - Windows hello (#2635)
This commit is contained in:
@@ -169,13 +169,12 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
|
||||
return await this.stateService.getEnableBiometric();
|
||||
}
|
||||
|
||||
authenticateBiometric(): Promise<boolean> {
|
||||
return new Promise((resolve) => {
|
||||
const val = ipcRenderer.sendSync("biometric", {
|
||||
action: "authenticate",
|
||||
});
|
||||
resolve(val);
|
||||
async authenticateBiometric(): Promise<boolean> {
|
||||
const val = await ipcRenderer.invoke("biometric", {
|
||||
action: "authenticate",
|
||||
});
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
supportsSecureStorage(): boolean {
|
||||
|
||||
@@ -5,39 +5,37 @@ import { StorageOptions } from "@bitwarden/common/models/domain/storageOptions";
|
||||
|
||||
export class ElectronRendererSecureStorageService implements AbstractStorageService {
|
||||
async get<T>(key: string, options?: StorageOptions): Promise<T> {
|
||||
const val = ipcRenderer.sendSync("keytar", {
|
||||
const val = await ipcRenderer.invoke("keytar", {
|
||||
action: "getPassword",
|
||||
key: key,
|
||||
keySuffix: options?.keySuffix ?? "",
|
||||
});
|
||||
return Promise.resolve(val != null ? (JSON.parse(val) as T) : null);
|
||||
return val != null ? (JSON.parse(val) as T) : null;
|
||||
}
|
||||
|
||||
async has(key: string, options?: StorageOptions): Promise<boolean> {
|
||||
const val = ipcRenderer.sendSync("keytar", {
|
||||
const val = await ipcRenderer.invoke("keytar", {
|
||||
action: "hasPassword",
|
||||
key: key,
|
||||
keySuffix: options?.keySuffix ?? "",
|
||||
});
|
||||
return Promise.resolve(!!val);
|
||||
return !!val;
|
||||
}
|
||||
|
||||
async save(key: string, obj: any, options?: StorageOptions): Promise<any> {
|
||||
ipcRenderer.sendSync("keytar", {
|
||||
await ipcRenderer.invoke("keytar", {
|
||||
action: "setPassword",
|
||||
key: key,
|
||||
keySuffix: options?.keySuffix ?? "",
|
||||
value: JSON.stringify(obj),
|
||||
});
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
async remove(key: string, options?: StorageOptions): Promise<any> {
|
||||
ipcRenderer.sendSync("keytar", {
|
||||
await ipcRenderer.invoke("keytar", {
|
||||
action: "deletePassword",
|
||||
key: key,
|
||||
keySuffix: options?.keySuffix ?? "",
|
||||
});
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user