mirror of
https://github.com/bitwarden/web
synced 2026-01-04 17:43:47 +00:00
33 lines
945 B
TypeScript
33 lines
945 B
TypeScript
import {
|
|
Component,
|
|
OnInit,
|
|
} from '@angular/core';
|
|
|
|
import { AuditService } from 'jslib/abstractions/audit.service';
|
|
import { UserService } from 'jslib/abstractions/user.service';
|
|
import { BreachAccountResponse } from 'jslib/models/response/breachAccountResponse';
|
|
|
|
@Component({
|
|
selector: 'app-breach-report',
|
|
templateUrl: 'breach-report.component.html',
|
|
})
|
|
export class BreachReportComponent implements OnInit {
|
|
loading = true;
|
|
error = false;
|
|
email: string;
|
|
breachedAccounts: BreachAccountResponse[] = [];
|
|
|
|
constructor(private auditService: AuditService, private userService: UserService) { }
|
|
|
|
async ngOnInit() {
|
|
this.loading = true;
|
|
try {
|
|
this.email = await this.userService.getEmail();
|
|
this.breachedAccounts = await this.auditService.breachedAccounts(this.email);
|
|
} catch {
|
|
this.error = true;
|
|
}
|
|
this.loading = false;
|
|
}
|
|
}
|