1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +00:00

Initial work

This commit is contained in:
gbubemismith
2023-07-25 15:45:11 -04:00
parent ca5b033cfd
commit 7daf604e3a
12 changed files with 126 additions and 16 deletions

View File

@@ -39,6 +39,8 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
showLoginWithDevice: boolean;
validatedEmail = false;
paramEmailSet = false;
redirectPath: string;
sessionId: string;
formGroup = this.formBuilder.group({
email: ["", [Validators.required, Validators.email]],
@@ -83,11 +85,17 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
this.route?.queryParams.subscribe((params) => {
if (params != null) {
const queryParamsEmail = params["email"];
this.redirectPath = params?.["redirectPath"];
this.sessionId = params?.["sessionId"];
if (queryParamsEmail != null && queryParamsEmail.indexOf("@") > -1) {
this.formGroup.get("email").setValue(queryParamsEmail);
this.loginService.setEmail(queryParamsEmail);
this.paramEmailSet = true;
}
//use redirectPath to redirect to a specific page after successful login
if (this.redirectPath) {
this.successRoute = this.redirectPath;
}
}
});
let email = this.loginService.getEmail();
@@ -142,7 +150,12 @@ export class LoginComponent extends CaptchaProtectedComponent implements OnInit
if (this.onSuccessfulLoginTwoFactorNavigate != null) {
this.onSuccessfulLoginTwoFactorNavigate();
} else {
this.router.navigate([this.twoFactorRoute]);
this.router.navigate([this.twoFactorRoute], {
queryParams: {
redirectPath: this.redirectPath,
sessionId: this.sessionId,
},
});
}
} else if (response.forcePasswordReset != ForceResetPasswordReason.None) {
if (this.onSuccessfulLoginForceResetNavigate != null) {