1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-27 22:11:38 +01:00

Simplify types for userkey in foreground-browser-biometrics and runtime.background.ts

This commit is contained in:
Bernd Schoolmann 2025-01-13 19:50:46 +01:00
parent 0daad18ffe
commit b2303957d7
No known key found for this signature in database
2 changed files with 3 additions and 5 deletions

View File

@ -195,8 +195,7 @@ export default class RuntimeBackground {
return await this.main.biometricsService.getBiometricsStatus();
}
case BiometricsCommands.UnlockWithBiometricsForUser: {
const userKey = await this.main.biometricsService.unlockWithBiometricsForUser(msg.userId);
return userKey.keyB64;
return await this.main.biometricsService.unlockWithBiometricsForUser(msg.userId);
}
case BiometricsCommands.GetBiometricsStatusForUser: {
return await this.main.biometricsService.getBiometricsStatusForUser(msg.userId);

View File

@ -1,4 +1,3 @@
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
import { UserId } from "@bitwarden/common/types/guid";
import { UserKey } from "@bitwarden/common/types/key";
import { BiometricsCommands, BiometricsService, BiometricsStatus } from "@bitwarden/key-management";
@ -29,13 +28,13 @@ export class ForegroundBrowserBiometricsService extends BiometricsService {
async unlockWithBiometricsForUser(userId: UserId): Promise<UserKey | null> {
const response = await BrowserApi.sendMessageWithResponse<{
result: string;
result: UserKey;
error: string;
}>(BiometricsCommands.UnlockWithBiometricsForUser, { userId });
if (!response.result) {
return null;
}
return SymmetricCryptoKey.fromString(response.result) as UserKey;
return response.result;
}
async getBiometricsStatusForUser(id: UserId): Promise<BiometricsStatus> {