1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 18:23:31 +00:00

Break up LoginComponent into client-specific services.

This commit is contained in:
Alec Rippberger
2024-09-25 22:07:37 -05:00
parent 7f14851147
commit a1b921691a
6 changed files with 263 additions and 45 deletions

View File

@@ -0,0 +1,25 @@
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"]);
}
}