1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-08 19:43:45 +00:00

Auth/PM-11945 - Registration with Email Verification - Fix Org Sponsored Free Family Plan not working (#11012)

* PM-11945 - AcceptOrg - fix inaccurate comment.

* PM-11945 - Refactor new registration process to pass along orgSponsoredFreeFamilyPlanToken

* PM-11945 - RegistrationFinishComponent - wire up passing of orgSponsoredFreeFamilyPlanToken to submit method

* PM-11945 - Add todo
This commit is contained in:
Jared Snider
2024-09-12 15:24:35 -04:00
committed by GitHub
parent fc2c83f0d3
commit b6cde7e3ef
7 changed files with 69 additions and 14 deletions

View File

@@ -66,17 +66,18 @@ export class WebRegistrationFinishService
// Note: the org invite token and email verification are mutually exclusive. Only one will be present.
override async buildRegisterRequest(
email: string,
emailVerificationToken: string,
passwordInputResult: PasswordInputResult,
encryptedUserKey: EncryptedString,
userAsymmetricKeys: [string, EncString],
emailVerificationToken?: string,
orgSponsoredFreeFamilyPlanToken?: string,
): Promise<RegisterFinishRequest> {
const registerRequest = await super.buildRegisterRequest(
email,
emailVerificationToken,
passwordInputResult,
encryptedUserKey,
userAsymmetricKeys,
emailVerificationToken,
);
// web specific logic
@@ -89,6 +90,10 @@ export class WebRegistrationFinishService
}
// Invite is accepted after login (on deep link redirect).
if (orgSponsoredFreeFamilyPlanToken) {
registerRequest.orgSponsoredFreeFamilyPlanToken = orgSponsoredFreeFamilyPlanToken;
}
return registerRequest;
}
}

View File

@@ -99,8 +99,7 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
email: invite.email,
};
} else if (registerRoute === "/signup") {
// We have to override the base component route b/c it is correct for other components
// that extend the base accept comp. We don't need users to complete email verification
// We have to override the base component route as we don't need users to complete email verification
// if they are coming directly from an emailed org invite.
registerRoute = "/finish-signup";
queryParams = {