mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 05:13:29 +00:00
[PM-2192] Improve userkey verification on biometric unlock (#10326)
* Improve biometric unlock userkey verification * Add early return * Pass activeuserid to cryptoservice functions
This commit is contained in:
@@ -418,4 +418,11 @@ export abstract class CryptoService {
|
||||
* @throws If an invalid user id is passed in.
|
||||
*/
|
||||
abstract userPublicKey$(userId: UserId): Observable<UserPublicKey>;
|
||||
|
||||
/**
|
||||
* Validates that a userkey is correct for a given user
|
||||
* @param key The key to validate
|
||||
* @param userId The user id for the key
|
||||
*/
|
||||
abstract validateUserKey(key: UserKey, userId: UserId): Promise<boolean>;
|
||||
}
|
||||
|
||||
@@ -620,7 +620,7 @@ export class CryptoService implements CryptoServiceAbstraction {
|
||||
}
|
||||
|
||||
// ---HELPERS---
|
||||
protected async validateUserKey(key: UserKey, userId: UserId): Promise<boolean> {
|
||||
async validateUserKey(key: UserKey, userId: UserId): Promise<boolean> {
|
||||
if (!key) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user