+
+
+
+
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
{{ "newAroundHere" | i18n }}
{{ "createAccount" | i18n }}
diff --git a/apps/browser/src/popup/accounts/home.component.ts b/apps/browser/src/popup/accounts/home.component.ts
index 25f5f6899162..28d42dc482a8 100644
--- a/apps/browser/src/popup/accounts/home.component.ts
+++ b/apps/browser/src/popup/accounts/home.component.ts
@@ -1,7 +1,6 @@
import { Component, OnInit } from "@angular/core";
import { FormBuilder, Validators } from "@angular/forms";
import { ActivatedRoute, Router } from "@angular/router";
-import { Subject, takeUntil } from "rxjs";
import { EnvironmentService } from "@bitwarden/common/abstractions/environment.service";
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
@@ -14,11 +13,9 @@ import { StateService } from "@bitwarden/common/abstractions/state.service";
})
export class HomeComponent implements OnInit {
loginInitiated = false;
- private destroy$ = new Subject();
formGroup = this.formBuilder.group({
email: ["", [Validators.required, Validators.email]],
- rememberEmail: [false],
});
constructor(
@@ -30,31 +27,11 @@ export class HomeComponent implements OnInit {
private environmentService: EnvironmentService,
private route: ActivatedRoute
) {}
-
- ngOnInit() {
- this.route?.queryParams.pipe(takeUntil(this.destroy$)).subscribe((params) => {
- if (params) {
- const queryParamsEmail = params["email"];
- const queryParamsRememberEmail = params["rememberEmail"];
- if (
- queryParamsEmail != null &&
- queryParamsEmail.indexOf("@") > -1 &&
- queryParamsRememberEmail != null
- ) {
- this.setFormGroupValues(queryParamsEmail, JSON.parse(queryParamsRememberEmail));
- }
- }
- });
- }
-
- ngOnDestroy(): void {
- this.destroy$.next();
- this.destroy$.complete();
- }
-
- async initiateLogin(): Promise {
- this.formGroup.patchValue({ email: await this.stateService.getRememberedEmail() });
- this.loginInitiated = true;
+ async ngOnInit(): Promise {
+ const rememberedEmail = await this.stateService.getRememberedEmail();
+ if (rememberedEmail != null) {
+ this.formGroup.patchValue({ email: await this.stateService.getRememberedEmail() });
+ }
}
submit() {
@@ -67,18 +44,13 @@ export class HomeComponent implements OnInit {
);
return;
}
- if (this.formGroup.value.rememberEmail) {
- this.stateService.setRememberedEmail(this.formGroup.value.email);
- }
+
+ this.stateService.setRememberedEmail(this.formGroup.value.email);
+
this.router.navigate(["login"], { queryParams: { email: this.formGroup.value.email } });
}
get selfHostedDomain() {
return this.environmentService.hasBaseUrl() ? this.environmentService.getWebVaultUrl() : null;
}
-
- async setFormGroupValues(email: string, rememberEmail: boolean) {
- this.formGroup.patchValue({ email: email, rememberEmail: rememberEmail });
- this.loginInitiated = true;
- }
}
diff --git a/apps/browser/src/popup/accounts/login.component.html b/apps/browser/src/popup/accounts/login.component.html
index 767057b9cf23..4dff637486cf 100644
--- a/apps/browser/src/popup/accounts/login.component.html
+++ b/apps/browser/src/popup/accounts/login.component.html
@@ -63,7 +63,7 @@
diff --git a/apps/browser/src/popup/accounts/login.component.ts b/apps/browser/src/popup/accounts/login.component.ts
index f3e1e5b970b5..1f16bd32db6d 100644
--- a/apps/browser/src/popup/accounts/login.component.ts
+++ b/apps/browser/src/popup/accounts/login.component.ts
@@ -109,14 +109,4 @@ export class LoginComponent extends BaseLoginComponent {
codeChallenge
);
}
-
- async goBackToHome() {
- await this.stateService.setRememberedEmail(null);
- this.router.navigate(["home"], {
- queryParams: {
- email: this.formGroup.value.email,
- rememberEmail: this.formGroup.value.rememberEmail,
- },
- });
- }
}
diff --git a/apps/browser/src/popup/app-routing.module.ts b/apps/browser/src/popup/app-routing.module.ts
index a041e870894d..d20a914249b2 100644
--- a/apps/browser/src/popup/app-routing.module.ts
+++ b/apps/browser/src/popup/app-routing.module.ts
@@ -23,7 +23,6 @@ import { SendAddEditComponent } from "./send/send-add-edit.component";
import { SendGroupingsComponent } from "./send/send-groupings.component";
import { SendTypeComponent } from "./send/send-type.component";
import { DebounceNavigationService } from "./services/debounceNavigationService";
-import { HomeGuard } from "./services/home.guard";
import { ExcludedDomainsComponent } from "./settings/excluded-domains.component";
import { ExportComponent } from "./settings/export.component";
import { FolderAddEditComponent } from "./settings/folder-add-edit.component";
@@ -57,7 +56,7 @@ const routes: Routes = [
{
path: "home",
component: HomeComponent,
- canActivate: [UnauthGuard, HomeGuard],
+ canActivate: [UnauthGuard],
data: { state: "home" },
},
{
diff --git a/apps/browser/src/popup/services/home.guard.ts b/apps/browser/src/popup/services/home.guard.ts
deleted file mode 100644
index 2344907aa84e..000000000000
--- a/apps/browser/src/popup/services/home.guard.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Injectable } from "@angular/core";
-import { Router } from "@angular/router";
-
-import { StateService } from "@bitwarden/common/abstractions/state.service";
-
-@Injectable()
-export class HomeGuard {
- constructor(private stateService: StateService, private router: Router) {}
-
- async canActivate() {
- const rememberedEmail = await this.stateService.getRememberedEmail();
-
- if (rememberedEmail == null) {
- return true;
- }
-
- return this.router.createUrlTree(["login"]);
- }
-}
diff --git a/apps/browser/src/popup/services/services.module.ts b/apps/browser/src/popup/services/services.module.ts
index 501c51f126f1..da96f7f90379 100644
--- a/apps/browser/src/popup/services/services.module.ts
+++ b/apps/browser/src/popup/services/services.module.ts
@@ -61,7 +61,6 @@ import BrowserMessagingPrivateModePopupService from "../../services/browserMessa
import { VaultFilterService } from "../../services/vaultFilter.service";
import { DebounceNavigationService } from "./debounceNavigationService";
-import { HomeGuard } from "./home.guard";
import { InitService } from "./init.service";
import { LockGuardService } from "./lock-guard.service";
import { PasswordRepromptService } from "./password-reprompt.service";
@@ -324,7 +323,6 @@ function getBgService