Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-3301] Login - Move incorrect username or password error to inline field error #11443

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
af9483d
setup new LoginComponent files in libs/auth
rr-bw Aug 20, 2024
2d60073
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
rr-bw Aug 21, 2024
af91d39
update pageTitle
rr-bw Aug 21, 2024
2b90cbb
handle loading email settings
rr-bw Aug 21, 2024
d4213fb
setup web-login.service.ts
rr-bw Aug 22, 2024
d917426
implement web onInit
rr-bw Aug 23, 2024
fcf01fe
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
rr-bw Aug 26, 2024
688a24b
fill out webOnInit
rr-bw Aug 27, 2024
97f9008
refactor getOrgPolicies call
rr-bw Aug 27, 2024
a5fec36
update import
rr-bw Aug 27, 2024
669585a
merge main
rr-bw Aug 30, 2024
9b28a0e
add validateEmail logic
rr-bw Aug 30, 2024
2a58a69
handle registerRoute
rr-bw Aug 30, 2024
621115a
add showPasswordless flag
rr-bw Aug 30, 2024
0cd840e
handle captcha
rr-bw Aug 31, 2024
983cee8
handle startAuthRequestLogin()
rr-bw Aug 31, 2024
19acf12
add handleMigrateEncryptionKey to default and web service
rr-bw Sep 2, 2024
48ffd0b
handle submit routing (web)
rr-bw Sep 2, 2024
1ad35b0
fix typo
rr-bw Sep 2, 2024
d74561d
merge main, fix conflicts
rr-bw Sep 5, 2024
d279ae4
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
rr-bw Sep 7, 2024
e190ca4
incorporate loginEmailService changes
rr-bw Sep 7, 2024
4f893e0
minor updates to comments for clarity
rr-bw Sep 7, 2024
e8c4217
create a defaultOnInit()
rr-bw Sep 7, 2024
70d15fb
update defaultOnInit()
rr-bw Sep 7, 2024
00a29b3
handle master password input focus
rr-bw Sep 9, 2024
3636c72
handle post-login routing on Browser/Desktop
rr-bw Sep 9, 2024
3c68fb0
handle browser/desktop syncService
rr-bw Sep 9, 2024
81a623d
handle browser ngOnInit
rr-bw Sep 9, 2024
bdd6f9f
handle browser routing and basic browser template
rr-bw Sep 9, 2024
4d1ab66
setup desktop router
rr-bw Sep 9, 2024
b564ff4
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
rr-bw Sep 9, 2024
e8e5ec2
add template for desktop first UI state: email entry
rr-bw Sep 9, 2024
b997b60
rename 'response' to 'authResult'
rr-bw Sep 10, 2024
40e2cb5
refactor handleMigrateEncryptionKey()
rr-bw Sep 10, 2024
7d8886e
refactor captcha methods and add return types
rr-bw Sep 10, 2024
feb16c3
refactor submit logic
rr-bw Sep 10, 2024
d098ee0
refactor submit logic further to use if statements with returns insteโ€ฆ
rr-bw Sep 10, 2024
9588148
remove toast error on invalid form for Browser/Desktop
rr-bw Sep 10, 2024
0826184
refactor to handleAuthResult() method
rr-bw Sep 10, 2024
d76f483
refactor webOnInit
rr-bw Sep 10, 2024
ff53fee
add comment to revisit ngOnInit logic
rr-bw Sep 10, 2024
b64552f
refactor handlCaptchaRequired()
rr-bw Sep 10, 2024
e2434ff
create a LoginSecondaryContentComponent for AnonLayout use
rr-bw Sep 10, 2024
04ca091
minor formatting for consistency
rr-bw Sep 11, 2024
0f62f07
add clarifying comment to handleAuthResult()
rr-bw Sep 11, 2024
8c78662
minor refactor to use destructuring
rr-bw Sep 11, 2024
c597b92
setup desktopOnInit()
rr-bw Sep 11, 2024
167b246
add continue() method
rr-bw Sep 11, 2024
e3219d2
handle desktop ngOnDestroy()
rr-bw Sep 11, 2024
b0f4ac1
add clarifying comment regarding secondary content
rr-bw Sep 11, 2024
234191e
fill out desktop template and submit()
rr-bw Sep 11, 2024
96f31ec
add descriptive comment to top of HTML file
rr-bw Sep 11, 2024
f9dc912
refactor to use a uiState enum for UI states
rr-bw Sep 11, 2024
c89eb92
handle oss-routing swap
rr-bw Sep 12, 2024
677829f
handle registerRoute$ in secondary content
rr-bw Sep 12, 2024
0cf965c
web template modifications
rr-bw Sep 12, 2024
8696330
change email validation to only run on submit (or when clicking contiโ€ฆ
rr-bw Sep 12, 2024
6ffaeae
add dynamic anon-layout wrapper data
rr-bw Sep 12, 2024
bb5f88f
remove static element ref
rr-bw Sep 12, 2024
7a4b83a
desktop HTML template updates
rr-bw Sep 12, 2024
9cb64b5
remove 'showPassword' property b/c now handled by bitPasswordInputToggle
rr-bw Sep 12, 2024
e616218
Extension: setup EmailEntry state UI
rr-bw Sep 12, 2024
350459f
Extension: setup MasterPasswordEntry state UI
rr-bw Sep 12, 2024
de4b177
merge main, fix conflicts
rr-bw Sep 13, 2024
4012a6c
ensure full sync happens on all clients before navigation
rr-bw Sep 13, 2024
c446345
update icon stroke color
rr-bw Sep 13, 2024
532d3ea
change old components to V1
rr-bw Sep 13, 2024
8fa5c55
remove 'V2' from new component
rr-bw Sep 13, 2024
80fd8bd
update captcha iframe on all clients
rr-bw Sep 13, 2024
236c41e
add browser redirect from /home to /login with FF on
rr-bw Sep 13, 2024
4df7712
add todo comment regarding browser template
rr-bw Sep 13, 2024
b799618
add launchSsoBrowser to extension template
rr-bw Sep 13, 2024
e076e94
move extension launchSsoBrowserWindow() to extension service
rr-bw Sep 14, 2024
66072f6
cleanup & comments
rr-bw Sep 14, 2024
da18b42
add launchSsoBrowserWindow() to default service
rr-bw Sep 14, 2024
d88606a
setup launchSsoBrowserWindow() for Desktop
rr-bw Sep 14, 2024
e0d4702
refactor to use toastService
rr-bw Sep 14, 2024
d49c044
remove unnecessary service injection
rr-bw Sep 14, 2024
0bb18eb
rename LoginService to LoginComponentService to avoid confusion with โ€ฆ
rr-bw Sep 14, 2024
6bbbfcd
add jsdocs to LoginComponentService
rr-bw Sep 14, 2024
6d1d02a
rename loginService prop to loginComponentService
rr-bw Sep 14, 2024
54f0c0a
Add vault icon to anon layout.
alec-livefront Sep 23, 2024
c37f726
Prevent email address validation on blur.
alec-livefront Sep 24, 2024
9bb8409
Fix comment typo.
alec-livefront Sep 24, 2024
d9f930d
Prefill email field when "create account" is clicked.
alec-livefront Sep 24, 2024
74767b0
Use factory function to provide LoginEmailService.
alec-livefront Sep 25, 2024
22eb2aa
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
alec-livefront Sep 25, 2024
9a6b1a9
Add test for RegisterFormComponent.
alec-livefront Sep 25, 2024
e0eff02
Remove back button todo.
alec-livefront Sep 25, 2024
3187a33
Consolidate clearing loginEmailService values and routing
alec-livefront Sep 25, 2024
7767545
Remove unnecessary navigation.
alec-livefront Sep 25, 2024
1206017
Fix client navigation after login.
alec-livefront Sep 25, 2024
7f14851
Consolidate login templates.
alec-livefront Sep 25, 2024
a1b9216
Break up LoginComponent into client-specific services.
alec-livefront Sep 26, 2024
309576f
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
alec-livefront Sep 26, 2024
588a7af
Rename login.component to login-v1.component
alec-livefront Sep 26, 2024
9a277d6
Rename login.component to login-v1.component
alec-livefront Sep 26, 2024
5628ad4
Revert "Rename login.component to login-v1.component"
alec-livefront Sep 26, 2024
2e6e5a5
Revert "Rename login.component to login-v1.component"
alec-livefront Sep 26, 2024
035e62e
Rename login.component to login-v1.component except browser.
alec-livefront Sep 26, 2024
60d1177
Comment out debug code.
alec-livefront Sep 26, 2024
a97dc74
Remove debug code.
alec-livefront Sep 26, 2024
e607aa7
Rename login.component to login-v1.component for browser.
alec-livefront Sep 26, 2024
07f1419
Add login-with-passkey route to desktop.
alec-livefront Sep 26, 2024
4ead4ef
Set feature flag to false.
alec-livefront Sep 26, 2024
c062970
Fix linting errors.
alec-livefront Sep 27, 2024
bf8312d
Populate email on registration start form.
alec-livefront Sep 27, 2024
bb67f56
Implement email population on all clients add add safeProviders.
alec-livefront Sep 27, 2024
30af195
Remove comment re. passing email to registration.
alec-livefront Sep 27, 2024
58d6770
Add unauthUiRefreshRedirect utility function.
alec-livefront Sep 27, 2024
b2a63e6
Add transparent border.
alec-livefront Sep 30, 2024
3140be2
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
alec-livefront Sep 30, 2024
fbb5e35
Merge branch 'main' of https://github.com/bitwarden/clients
alec-livefront Sep 30, 2024
7190f4d
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
alec-livefront Sep 30, 2024
ea8cd09
Merge main and add satisfies RouteDataProperties
alec-livefront Sep 30, 2024
79b2633
PM-8111 - Extension - AppRoutingModule - Home route now redirects conโ€ฆ
JaredSnider-Bitwarden Sep 30, 2024
d1a0c2f
PM-8111 - New Login Comp + Login Comp Svc - (1) Refactor naming and rโ€ฆ
JaredSnider-Bitwarden Sep 30, 2024
04fa618
PM-8111 - TODO cleanup
JaredSnider-Bitwarden Sep 30, 2024
8469e35
PM-8111 - (1) Cleanup DefaultLoginComponentService (2) Sso Connector โ€ฆ
JaredSnider-Bitwarden Sep 30, 2024
86a10f2
PM-8111 - Two TODO cleanups
JaredSnider-Bitwarden Sep 30, 2024
a104a92
Remove specific client services.
alec-livefront Oct 1, 2024
ca0520c
Add isLoginWithPasskeySupported function to reduce client type checkiโ€ฆ
alec-livefront Oct 1, 2024
4f11c2c
Add styles missing from Browser to Create Account link.
alec-livefront Oct 1, 2024
f42a391
Confirmed inline form errors working and removing todo comments.
alec-livefront Oct 1, 2024
2d5f4df
Convert refactoring todo-rr-bw to standard todos.
alec-livefront Oct 1, 2024
d47ffdf
Add login component services tests.
alec-livefront Oct 2, 2024
bdc988c
Cleanup formatting and remove unused provider.
alec-livefront Oct 2, 2024
f8f8bb5
Add comment to explain call to setLoginEmail.
alec-livefront Oct 2, 2024
c0d37bc
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
alec-livefront Oct 2, 2024
66536d4
Rearrange imports to fix lint error.
alec-livefront Oct 2, 2024
9308a47
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
alec-livefront Oct 3, 2024
68f358b
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
alec-livefront Oct 4, 2024
f6d59dc
Adjust styles for password hint link.
alec-livefront Oct 4, 2024
db7b45f
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
alec-livefront Oct 4, 2024
cead261
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
alec-livefront Oct 4, 2024
51e8614
Show master password error inline.
alec-livefront Oct 7, 2024
0df9474
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
alec-livefront Oct 7, 2024
467d773
Remove new error handling from v1 component.
alec-livefront Oct 7, 2024
d1a5455
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
alec-livefront Oct 8, 2024
994e097
Address PR feedback: use strict comparison.
alec-livefront Oct 8, 2024
2bb89a4
Ensure Login with Passkey button is shown by setting clientType.
alec-livefront Oct 9, 2024
5aec3e8
Update "continue" button from "submit" to "button" type.
alec-livefront Oct 9, 2024
8975b60
Ensure Passkey login available for web and desktop.
alec-livefront Oct 9, 2024
57044a6
Validate email on enter keypress.
alec-livefront Oct 9, 2024
6e337e1
Use click event to trigger goToHint.
alec-livefront Oct 9, 2024
47ce605
Restructure handAuthResult to ensure we redirect to vault.
alec-livefront Oct 9, 2024
6d980bf
Add await to saveEmailSettings function.
alec-livefront Oct 9, 2024
982da46
Directly set clientType in individual login component services.
alec-livefront Oct 9, 2024
3868dcb
Get clientType via service.
alec-livefront Oct 10, 2024
90a24cb
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
alec-livefront Oct 10, 2024
ea68572
Add back button.
alec-livefront Oct 10, 2024
1b17ddc
Merge branch 'main' into auth/pm-8111/browser-refresh-login-component
alec-livefront Oct 10, 2024
9b20322
Remove hardcoded colors from Vault Icon
alec-livefront Oct 10, 2024
7533089
Removing register component changes.
alec-livefront Oct 10, 2024
99ddbc9
Removing register component changes.
alec-livefront Oct 10, 2024
3936ccd
Ensure isLoginWithPasskeySupported is only returns true for web client.
alec-livefront Oct 10, 2024
72f07fe
Remove Web/Desktop comment from html template
alec-livefront Oct 10, 2024
a2fa009
Merge branch 'auth/pm-8111/browser-refresh-login-component' into authโ€ฆ
alec-livefront Oct 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions apps/browser/src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@
"createAccount": {
"message": "Create account"
},
"newToBitwarden": {
"message": "New to Bitwarden?"
},
"logInWithPasskey": {
"message": "Log in with passkey"
},
"useSingleSignOn": {
"message": "Use single sign-on"
},
"welcomeBack": {
"message": "Welcome back"
},
"or": {
"message": "or"
},
"setAStrongPassword": {
"message": "Set a strong password"
},
Expand Down Expand Up @@ -805,6 +820,9 @@
"logIn": {
"message": "Log in"
},
"logInToBitwarden": {
"message": "Log in to Bitwarden"
},
"restartRegistration": {
"message": "Restart registration"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { ActivatedRoute, Router } from "@angular/router";
import { firstValueFrom } from "rxjs";

import { LoginComponent as BaseLoginComponent } from "@bitwarden/angular/auth/components/login.component";
import { LoginComponentV1 as BaseLoginComponent } from "@bitwarden/angular/auth/components/login-v1.component";

Check warning on line 6 in apps/browser/src/auth/popup/login-v1.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/auth/popup/login-v1.component.ts#L6

Added line #L6 was not covered by tests
import { FormValidationErrorsService } from "@bitwarden/angular/platform/abstractions/form-validation-errors.service";
import {
LoginStrategyServiceAbstraction,
Expand All @@ -29,9 +29,9 @@

@Component({
selector: "app-login",
templateUrl: "login.component.html",
templateUrl: "login-v1.component.html",
})
export class LoginComponent extends BaseLoginComponent implements OnInit {
export class LoginComponentV1 extends BaseLoginComponent implements OnInit {

Check warning on line 34 in apps/browser/src/auth/popup/login-v1.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/auth/popup/login-v1.component.ts#L34

Added line #L34 was not covered by tests
showPasswordless = false;
constructor(
devicesApiService: DevicesApiServiceAbstraction,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { TestBed } from "@angular/core/testing";
import { MockProxy, mock } from "jest-mock-extended";

import { DefaultLoginComponentService } from "@bitwarden/auth/angular";
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { PasswordGenerationServiceAbstraction } from "@bitwarden/generator-legacy";

import { flagEnabled } from "../../../platform/flags";
import { BrowserPlatformUtilsService } from "../../../platform/services/platform-utils/browser-platform-utils.service";

import { ExtensionLoginComponentService } from "./extension-login-component.service";

jest.mock("../../../platform/flags", () => ({
flagEnabled: jest.fn(),
}));

describe("ExtensionLoginComponentService", () => {
let service: ExtensionLoginComponentService;
let cryptoFunctionService: MockProxy<CryptoFunctionService>;
let environmentService: MockProxy<EnvironmentService>;
let passwordGenerationService: MockProxy<PasswordGenerationServiceAbstraction>;
let platformUtilsService: MockProxy<BrowserPlatformUtilsService>;
let ssoLoginService: MockProxy<SsoLoginServiceAbstraction>;

beforeEach(() => {
cryptoFunctionService = mock<CryptoFunctionService>();
environmentService = mock<EnvironmentService>();
passwordGenerationService = mock<PasswordGenerationServiceAbstraction>();
platformUtilsService = mock<BrowserPlatformUtilsService>();
ssoLoginService = mock<SsoLoginServiceAbstraction>();

TestBed.configureTestingModule({
providers: [
{
provide: ExtensionLoginComponentService,
useFactory: () =>
new ExtensionLoginComponentService(
cryptoFunctionService,
environmentService,
passwordGenerationService,
platformUtilsService,
ssoLoginService,
),
},
{ provide: DefaultLoginComponentService, useExisting: ExtensionLoginComponentService },
{ provide: CryptoFunctionService, useValue: cryptoFunctionService },
{ provide: EnvironmentService, useValue: environmentService },
{ provide: PasswordGenerationServiceAbstraction, useValue: passwordGenerationService },
{ provide: PlatformUtilsService, useValue: platformUtilsService },
{ provide: SsoLoginServiceAbstraction, useValue: ssoLoginService },
],
});
service = TestBed.inject(ExtensionLoginComponentService);
});

it("creates the service", () => {
expect(service).toBeTruthy();
});

it("returns true if showPasswordless flag is enabled", () => {
(flagEnabled as jest.Mock).mockReturnValue(true);
expect(service.isLoginViaAuthRequestSupported()).toBe(true);
});

it("returns false if showPasswordless flag is disabled", () => {
(flagEnabled as jest.Mock).mockReturnValue(false);
expect(service.isLoginViaAuthRequestSupported()).toBeFalsy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Injectable } from "@angular/core";

import { DefaultLoginComponentService, LoginComponentService } from "@bitwarden/auth/angular";
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { PasswordGenerationServiceAbstraction } from "@bitwarden/generator-legacy";

import { flagEnabled } from "../../../platform/flags";

@Injectable()
export class ExtensionLoginComponentService
extends DefaultLoginComponentService
implements LoginComponentService
{
constructor(
cryptoFunctionService: CryptoFunctionService,
environmentService: EnvironmentService,
passwordGenerationService: PasswordGenerationServiceAbstraction,
platformUtilsService: PlatformUtilsService,
ssoLoginService: SsoLoginServiceAbstraction,
) {
super(
cryptoFunctionService,
environmentService,
passwordGenerationService,
platformUtilsService,
ssoLoginService,
);
this.clientType = this.platformUtilsService.getClientType();
}

isLoginViaAuthRequestSupported(): boolean {
return flagEnabled("showPasswordless");
}
}
43 changes: 35 additions & 8 deletions apps/browser/src/popup/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { ActivatedRouteSnapshot, RouteReuseStrategy, RouterModule, Routes } from "@angular/router";

import { EnvironmentSelectorComponent } from "@bitwarden/angular/auth/components/environment-selector.component";
import { unauthUiRefreshRedirect } from "@bitwarden/angular/auth/functions/unauth-ui-refresh-redirect";

Check warning on line 5 in apps/browser/src/popup/app-routing.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/popup/app-routing.module.ts#L5

Added line #L5 was not covered by tests
import { unauthUiRefreshSwap } from "@bitwarden/angular/auth/functions/unauth-ui-refresh-route-swap";
import {
authGuard,
Expand All @@ -16,6 +17,8 @@
import {
AnonLayoutWrapperComponent,
AnonLayoutWrapperData,
LoginComponent,
LoginSecondaryContentComponent,
LockIcon,
LockV2Component,
PasswordHintComponent,
Expand All @@ -25,6 +28,7 @@
RegistrationStartSecondaryComponentData,
SetPasswordJitComponent,
UserLockIcon,
VaultIcon,
} from "@bitwarden/auth/angular";
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";

Expand All @@ -40,8 +44,8 @@
import { HomeComponent } from "../auth/popup/home.component";
import { LockComponent } from "../auth/popup/lock.component";
import { LoginDecryptionOptionsComponent } from "../auth/popup/login-decryption-options/login-decryption-options.component";
import { LoginComponentV1 } from "../auth/popup/login-v1.component";

Check warning on line 47 in apps/browser/src/popup/app-routing.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/popup/app-routing.module.ts#L47

Added line #L47 was not covered by tests
import { LoginViaAuthRequestComponent } from "../auth/popup/login-via-auth-request.component";
import { LoginComponent } from "../auth/popup/login.component";
import { RegisterComponent } from "../auth/popup/register.component";
import { RemovePasswordComponent } from "../auth/popup/remove-password.component";
import { SetPasswordComponent } from "../auth/popup/set-password.component";
Expand Down Expand Up @@ -152,20 +156,14 @@
{
path: "home",
component: HomeComponent,
canActivate: [unauthGuardFn(unauthRouteOverrides)],
canActivate: [unauthGuardFn(unauthRouteOverrides), unauthUiRefreshRedirect("/login")],
data: { state: "home" } satisfies RouteDataProperties,
},
...extensionRefreshSwap(Fido2V1Component, Fido2Component, {
path: "fido2",
canActivate: [fido2AuthGuard],
data: { state: "fido2" } satisfies RouteDataProperties,
}),
{
path: "login",
component: LoginComponent,
canActivate: [unauthGuardFn(unauthRouteOverrides)],
data: { state: "login" } satisfies RouteDataProperties,
},
{
path: "login-with-device",
component: LoginViaAuthRequestComponent,
Expand Down Expand Up @@ -440,6 +438,35 @@
],
},
),
...unauthUiRefreshSwap(
LoginComponentV1,
ExtensionAnonLayoutWrapperComponent,
{
path: "login",
canActivate: [unauthGuardFn(unauthRouteOverrides)],
data: { state: "login" },
},
{
path: "",
children: [
{
path: "login",
canActivate: [unauthGuardFn(unauthRouteOverrides)],
data: {
pageIcon: VaultIcon,
pageTitle: "logInToBitwarden",
state: "login",
showAcctSwitcher: true,
} satisfies RouteDataProperties & ExtensionAnonLayoutWrapperData,
children: [
{ path: "", component: LoginComponent },
{ path: "", component: LoginSecondaryContentComponent, outlet: "secondary" },
{ path: "", component: EnvironmentSelectorComponent, outlet: "environment-selector" },
],
},
],
},
),
{
path: "",
component: ExtensionAnonLayoutWrapperComponent,
Expand Down
4 changes: 2 additions & 2 deletions apps/browser/src/popup/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import { HomeComponent } from "../auth/popup/home.component";
import { LockComponent } from "../auth/popup/lock.component";
import { LoginDecryptionOptionsComponent } from "../auth/popup/login-decryption-options/login-decryption-options.component";
import { LoginComponentV1 } from "../auth/popup/login-v1.component";

Check warning on line 28 in apps/browser/src/popup/app.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/popup/app.module.ts#L28

Added line #L28 was not covered by tests
import { LoginViaAuthRequestComponent } from "../auth/popup/login-via-auth-request.component";
import { LoginComponent } from "../auth/popup/login.component";
import { RegisterComponent } from "../auth/popup/register.component";
import { RemovePasswordComponent } from "../auth/popup/remove-password.component";
import { SetPasswordComponent } from "../auth/popup/set-password.component";
Expand Down Expand Up @@ -159,7 +159,7 @@
HintComponent,
HomeComponent,
LockComponent,
LoginComponent,
LoginComponentV1,
LoginViaAuthRequestComponent,
LoginDecryptionOptionsComponent,
NotificationsSettingsV1Component,
Expand Down
30 changes: 27 additions & 3 deletions apps/browser/src/popup/services/services.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { APP_INITIALIZER, NgModule, NgZone } from "@angular/core";
import { Subject, merge, of } from "rxjs";

import { CollectionService } from "@bitwarden/admin-console/common";

Check warning on line 4 in apps/browser/src/popup/services/services.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/popup/services/services.module.ts#L4

Added line #L4 was not covered by tests
import { ViewCacheService } from "@bitwarden/angular/platform/abstractions/view-cache.service";
import { AngularThemingService } from "@bitwarden/angular/platform/services/theming/angular-theming.service";
import { SafeProvider, safeProvider } from "@bitwarden/angular/platform/utils/safe-provider";
Expand All @@ -18,7 +18,11 @@
ENV_ADDITIONAL_REGIONS,
} from "@bitwarden/angular/services/injection-tokens";
import { JslibServicesModule } from "@bitwarden/angular/services/jslib-services.module";
import { AnonLayoutWrapperDataService, LockComponentService } from "@bitwarden/auth/angular";
import {

Check warning on line 21 in apps/browser/src/popup/services/services.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/popup/services/services.module.ts#L21

Added line #L21 was not covered by tests
AnonLayoutWrapperDataService,
LoginComponentService,
LockComponentService,
} from "@bitwarden/auth/angular";
import { LockService, PinServiceAbstraction } from "@bitwarden/auth/common";
import { EventCollectionService as EventCollectionServiceAbstraction } from "@bitwarden/common/abstractions/event/event-collection.service";
import { NotificationsService } from "@bitwarden/common/abstractions/notifications.service";
Expand All @@ -29,6 +33,7 @@
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
import { KdfConfigService } from "@bitwarden/common/auth/abstractions/kdf-config.service";
import { InternalMasterPasswordServiceAbstraction } from "@bitwarden/common/auth/abstractions/master-password.service.abstraction";
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";

Check warning on line 36 in apps/browser/src/popup/services/services.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/popup/services/services.module.ts#L36

Added line #L36 was not covered by tests
import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction";
import {
AutofillSettingsService,
Expand All @@ -49,7 +54,10 @@
DefaultAnimationControlService,
} from "@bitwarden/common/platform/abstractions/animation-control.service";
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
import {

Check warning on line 57 in apps/browser/src/popup/services/services.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/popup/services/services.module.ts#L57

Added line #L57 was not covered by tests
CryptoFunctionService,
CryptoFunctionService as CryptoFunctionServiceAbstraction,
} from "@bitwarden/common/platform/abstractions/crypto-function.service";
import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service";
import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service";
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
Expand All @@ -58,8 +66,11 @@
import { KeyGenerationService } from "@bitwarden/common/platform/abstractions/key-generation.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { MessagingService as MessagingServiceAbstraction } from "@bitwarden/common/platform/abstractions/messaging.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import {

Check warning on line 69 in apps/browser/src/popup/services/services.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/popup/services/services.module.ts#L69

Added line #L69 was not covered by tests
PlatformUtilsService,
PlatformUtilsService as PlatformUtilsServiceAbstraction,
} from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { SdkClientFactory } from "@bitwarden/common/platform/abstractions/sdk/sdk-client-factory";

Check warning on line 73 in apps/browser/src/popup/services/services.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/popup/services/services.module.ts#L73

Added line #L73 was not covered by tests
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
import {
AbstractStorageService,
Expand All @@ -68,11 +79,11 @@
import { Message, MessageListener, MessageSender } from "@bitwarden/common/platform/messaging";
// eslint-disable-next-line no-restricted-imports -- Used for dependency injection
import { SubjectMessageSender } from "@bitwarden/common/platform/messaging/internal";
import { flagEnabled } from "@bitwarden/common/platform/misc/flags";

Check warning on line 82 in apps/browser/src/popup/services/services.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/popup/services/services.module.ts#L82

Added line #L82 was not covered by tests
import { TaskSchedulerService } from "@bitwarden/common/platform/scheduling";
import { ConsoleLogService } from "@bitwarden/common/platform/services/console-log.service";
import { ContainerService } from "@bitwarden/common/platform/services/container.service";
import { NoopSdkClientFactory } from "@bitwarden/common/platform/services/sdk/noop-sdk-client-factory";

Check warning on line 86 in apps/browser/src/popup/services/services.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/popup/services/services.module.ts#L86

Added line #L86 was not covered by tests
import { StorageServiceProvider } from "@bitwarden/common/platform/services/storage-service.provider";
import { WebCryptoFunctionService } from "@bitwarden/common/platform/services/web-crypto-function.service";
import {
Expand All @@ -91,11 +102,13 @@
import { TotpService as TotpServiceAbstraction } from "@bitwarden/common/vault/abstractions/totp.service";
import { TotpService } from "@bitwarden/common/vault/services/totp.service";
import { DialogService, ToastService } from "@bitwarden/components";
import { PasswordGenerationServiceAbstraction } from "@bitwarden/generator-legacy";

Check warning on line 105 in apps/browser/src/popup/services/services.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/popup/services/services.module.ts#L105

Added line #L105 was not covered by tests
import { BiometricsService, BiometricStateService } from "@bitwarden/key-management";
import { PasswordRepromptService } from "@bitwarden/vault";

import { ForegroundLockService } from "../../auth/popup/accounts/foreground-lock.service";
import { ExtensionAnonLayoutWrapperDataService } from "../../auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper-data.service";
import { ExtensionLoginComponentService } from "../../auth/popup/login/extension-login-component.service";

Check warning on line 111 in apps/browser/src/popup/services/services.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/popup/services/services.module.ts#L111

Added line #L111 was not covered by tests
import { AutofillService as AutofillServiceAbstraction } from "../../autofill/services/abstractions/autofill.service";
import AutofillService from "../../autofill/services/autofill.service";
import MainBackground from "../../background/main.background";
Expand All @@ -117,7 +130,7 @@
import { BrowserScriptInjectorService } from "../../platform/services/browser-script-injector.service";
import I18nService from "../../platform/services/i18n.service";
import { ForegroundPlatformUtilsService } from "../../platform/services/platform-utils/foreground-platform-utils.service";
import { BrowserSdkClientFactory } from "../../platform/services/sdk/browser-sdk-client-factory";

Check warning on line 133 in apps/browser/src/popup/services/services.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/browser/src/popup/services/services.module.ts#L133

Added line #L133 was not covered by tests
import { ForegroundTaskSchedulerService } from "../../platform/services/task-scheduler/foreground-task-scheduler.service";
import { BrowserStorageServiceProvider } from "../../platform/storage/browser-storage-service.provider";
import { ForegroundMemoryStorageService } from "../../platform/storage/foreground-memory-storage.service";
Expand Down Expand Up @@ -571,6 +584,17 @@
useClass: ExtensionAnonLayoutWrapperDataService,
deps: [],
}),
safeProvider({
provide: LoginComponentService,
useClass: ExtensionLoginComponentService,
deps: [
CryptoFunctionServiceAbstraction,
EnvironmentService,
PasswordGenerationServiceAbstraction,
PlatformUtilsServiceAbstraction,
SsoLoginServiceAbstraction,
],
}),
safeProvider({
provide: LockService,
useClass: ForegroundLockService,
Expand Down
Loading
Loading