mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-28 12:45:45 +01:00
breach check changed to username
This commit is contained in:
parent
93edd272dd
commit
e297f39bd5
@ -2,5 +2,5 @@ import { BreachAccountResponse } from '../models/response/breachAccountResponse'
|
|||||||
|
|
||||||
export abstract class AuditService {
|
export abstract class AuditService {
|
||||||
passwordLeaked: (password: string) => Promise<number>;
|
passwordLeaked: (password: string) => Promise<number>;
|
||||||
breachedAccounts: (email: string) => Promise<BreachAccountResponse[]>;
|
breachedAccounts: (username: string) => Promise<BreachAccountResponse[]>;
|
||||||
}
|
}
|
||||||
|
@ -26,8 +26,8 @@ export class AuditService implements AuditServiceAbstraction {
|
|||||||
return match != null ? parseInt(match.split(':')[1], 10) : 0;
|
return match != null ? parseInt(match.split(':')[1], 10) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
async breachedAccounts(email: string): Promise<BreachAccountResponse[]> {
|
async breachedAccounts(username: string): Promise<BreachAccountResponse[]> {
|
||||||
const response = await fetch(HibpBreachApi + email);
|
const response = await fetch(HibpBreachApi + username);
|
||||||
if (response.status === 404) {
|
if (response.status === 404) {
|
||||||
return [];
|
return [];
|
||||||
} else if (response.status !== 200) {
|
} else if (response.status !== 200) {
|
||||||
|
Loading…
Reference in New Issue
Block a user