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:
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -63,8 +63,8 @@ export class LockComponent extends BaseLockComponent {
|
||||
policyApiService,
|
||||
policyService,
|
||||
passwordStrengthService,
|
||||
dialogService,
|
||||
route
|
||||
route,
|
||||
dialogService
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user