1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 18:53:29 +00:00

changed breach report to allow username entry

This commit is contained in:
Kyle Spearrin
2018-06-29 08:21:08 -04:00
parent dec6b17aa4
commit 15d6e4937f
4 changed files with 42 additions and 18 deletions

View File

@@ -12,21 +12,27 @@ import { BreachAccountResponse } from 'jslib/models/response/breachAccountRespon
templateUrl: 'breach-report.component.html',
})
export class BreachReportComponent implements OnInit {
loading = true;
error = false;
email: string;
username: string;
checkedUsername: string;
breachedAccounts: BreachAccountResponse[] = [];
formPromise: Promise<BreachAccountResponse[]>;
constructor(private auditService: AuditService, private userService: UserService) { }
async ngOnInit() {
this.loading = true;
this.username = await this.userService.getEmail();
}
async submit() {
this.error = false;
this.username = this.username.toLowerCase();
try {
this.email = await this.userService.getEmail();
this.breachedAccounts = await this.auditService.breachedAccounts(this.email);
this.formPromise = this.auditService.breachedAccounts(this.username);
this.breachedAccounts = await this.formPromise;
} catch {
this.error = true;
}
this.loading = false;
this.checkedUsername = this.username;
}
}