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:
25
libs/auth/src/angular/login/extension-login.service.ts
Normal file
25
libs/auth/src/angular/login/extension-login.service.ts
Normal 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"]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user