mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
26 lines
667 B
TypeScript
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"]);
|
|
}
|
|
}
|