mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
Use factory function to provide LoginEmailService.
This commit is contained in:
@@ -22,11 +22,24 @@ import { PasswordGenerationServiceAbstraction } from "@bitwarden/generator-legac
|
|||||||
|
|
||||||
import { AcceptOrganizationInviteService } from "../organization-invite/accept-organization.service";
|
import { AcceptOrganizationInviteService } from "../organization-invite/accept-organization.service";
|
||||||
import { LoginEmailService } from "../../../../../../libs/auth/src/common/services/login-email/login-email.service";
|
import { LoginEmailService } from "../../../../../../libs/auth/src/common/services/login-email/login-email.service";
|
||||||
|
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||||
|
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
|
||||||
|
import { StateProvider } from "@bitwarden/common/platform/state";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-register-form",
|
selector: "app-register-form",
|
||||||
templateUrl: "./register-form.component.html",
|
templateUrl: "./register-form.component.html",
|
||||||
providers: [LoginEmailService],
|
providers: [
|
||||||
|
{
|
||||||
|
provide: LoginEmailService,
|
||||||
|
useFactory: (
|
||||||
|
accountService: AccountService,
|
||||||
|
authService: AuthService,
|
||||||
|
stateProvider: StateProvider,
|
||||||
|
) => new LoginEmailService(accountService, authService, stateProvider),
|
||||||
|
deps: [AccountService, AuthService, StateProvider],
|
||||||
|
},
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class RegisterFormComponent extends BaseRegisterComponent implements OnInit {
|
export class RegisterFormComponent extends BaseRegisterComponent implements OnInit {
|
||||||
@Input() queryParamEmail: string;
|
@Input() queryParamEmail: string;
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import {
|
|||||||
StateProvider,
|
StateProvider,
|
||||||
} from "../../../../../common/src/platform/state";
|
} from "../../../../../common/src/platform/state";
|
||||||
import { LoginEmailServiceAbstraction } from "../../abstractions/login-email.service";
|
import { LoginEmailServiceAbstraction } from "../../abstractions/login-email.service";
|
||||||
import { Injectable } from "@angular/core";
|
|
||||||
|
|
||||||
export const LOGIN_EMAIL = new KeyDefinition<string>(LOGIN_EMAIL_MEMORY, "loginEmail", {
|
export const LOGIN_EMAIL = new KeyDefinition<string>(LOGIN_EMAIL_MEMORY, "loginEmail", {
|
||||||
deserializer: (value: string) => value,
|
deserializer: (value: string) => value,
|
||||||
@@ -22,7 +21,6 @@ export const STORED_EMAIL = new KeyDefinition<string>(LOGIN_EMAIL_DISK, "storedE
|
|||||||
deserializer: (value: string) => value,
|
deserializer: (value: string) => value,
|
||||||
});
|
});
|
||||||
|
|
||||||
@Injectable()
|
|
||||||
export class LoginEmailService implements LoginEmailServiceAbstraction {
|
export class LoginEmailService implements LoginEmailServiceAbstraction {
|
||||||
private rememberEmail: boolean;
|
private rememberEmail: boolean;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user