1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

Refactored components to make the redirectUrl more generic, fixed code review comments

This commit is contained in:
gbubemismith
2023-08-23 01:36:23 -04:00
parent ef4a1d9b7b
commit 6a05ba3ad0
6 changed files with 66 additions and 74 deletions

View File

@@ -82,14 +82,15 @@ export class HomeComponent implements OnInit, OnDestroy {
this.loginService.setEmail(this.formGroup.value.email);
this.loginService.setRememberEmail(this.formGroup.value.rememberEmail);
// const decodedRedirectUrl = decodeURIComponent(this.route.snapshot.queryParams.redirectUrl);
// console.log(decodedRedirectUrl, this.route);
this.router.navigate(["login"], {
queryParams: {
email: this.formGroup.value.email,
redirectUrl: this.route.snapshot.queryParams.redirectUrl,
},
});
const queryParams: { email: string; redirectUrl?: string } = {
email: this.formGroup.value.email,
};
if (this.route.snapshot.queryParams.redirectUrl) {
queryParams.redirectUrl = decodeURIComponent(this.route.snapshot.queryParams.redirectUrl);
}
this.router.navigate(["login"], { queryParams });
}
get selfHostedDomain() {

View File

@@ -50,8 +50,8 @@ export class LockComponent extends BaseLockComponent {
policyService: InternalPolicyService,
passwordStrengthService: PasswordStrengthServiceAbstraction,
private authService: AuthService,
dialogService: DialogServiceAbstraction,
route: ActivatedRoute
route: ActivatedRoute,
dialogService: DialogServiceAbstraction
) {
super(
router,
@@ -70,8 +70,8 @@ export class LockComponent extends BaseLockComponent {
policyApiService,
policyService,
passwordStrengthService,
dialogService,
route
route,
dialogService
);
this.successRoute = "/tabs/current";
this.isInitialLockScreen = (window as any).previousPopupUrl == null;

View File

@@ -63,8 +63,8 @@ export class LockComponent extends BaseLockComponent {
policyApiService,
policyService,
passwordStrengthService,
dialogService,
route
route,
dialogService
);
}