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 {
|
||||
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;
|
||||
}
|
||||
|
||||
async breachedAccounts(email: string): Promise<BreachAccountResponse[]> {
|
||||
const response = await fetch(HibpBreachApi + email);
|
||||
async breachedAccounts(username: string): Promise<BreachAccountResponse[]> {
|
||||
const response = await fetch(HibpBreachApi + username);
|
||||
if (response.status === 404) {
|
||||
return [];
|
||||
} else if (response.status !== 200) {
|
||||
|
|
Loading…
Reference in New Issue