1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00
Files
browser/libs/auth/src/angular/login/extension-login.service.ts
2024-09-25 22:07:37 -05:00

26 lines
667 B
TypeScript

import { Injectable } from "@angular/core";
import { Router } from "@angular/router";
import { LoginEmailServiceAbstraction } from "@bitwarden/auth/common";
/**
* Functionality for the extension login component.
*/
@Injectable({
providedIn: "root",
})
export class ExtensionLoginService {
constructor(
private router: Router,
private loginEmailService: LoginEmailServiceAbstraction,
) {}
/**
* Handles the successful login - clears the login email service values and navigates to the vault.
*/
async handleSuccessfulLogin(): Promise<void> {
this.loginEmailService.clearValues();
await this.router.navigate(["/tabs/vault"]);
}
}