mirror of
https://github.com/bitwarden/browser
synced 2025-12-28 06:03:40 +00:00
* [deps] Autofill: Update prettier to v3 * prettier formatting updates --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
45 lines
1.7 KiB
TypeScript
45 lines
1.7 KiB
TypeScript
import { Component } from "@angular/core";
|
|
|
|
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
|
import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction";
|
|
import { Verification } from "@bitwarden/common/auth/types/verification";
|
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
|
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
|
|
|
@Component({
|
|
selector: "app-deauthorize-sessions",
|
|
templateUrl: "deauthorize-sessions.component.html",
|
|
})
|
|
export class DeauthorizeSessionsComponent {
|
|
masterPassword: Verification;
|
|
formPromise: Promise<unknown>;
|
|
|
|
constructor(
|
|
private apiService: ApiService,
|
|
private i18nService: I18nService,
|
|
private platformUtilsService: PlatformUtilsService,
|
|
private userVerificationService: UserVerificationService,
|
|
private messagingService: MessagingService,
|
|
private logService: LogService,
|
|
) {}
|
|
|
|
async submit() {
|
|
try {
|
|
this.formPromise = this.userVerificationService
|
|
.buildRequest(this.masterPassword)
|
|
.then((request) => this.apiService.postSecurityStamp(request));
|
|
await this.formPromise;
|
|
this.platformUtilsService.showToast(
|
|
"success",
|
|
this.i18nService.t("sessionsDeauthorized"),
|
|
this.i18nService.t("logBackIn"),
|
|
);
|
|
this.messagingService.send("logout");
|
|
} catch (e) {
|
|
this.logService.error(e);
|
|
}
|
|
}
|
|
}
|