1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 00:33:44 +00:00

handle loading email settings

This commit is contained in:
rr-bw
2024-08-21 14:54:07 -07:00
parent af91d39c57
commit 2b90cbb3e5
4 changed files with 33 additions and 9 deletions

View File

@@ -108,6 +108,7 @@ export class LoginComponent extends BaseLoginComponent implements OnInit {
async ngOnInit() {
// eslint-disable-next-line rxjs-angular/prefer-takeuntil, rxjs/no-async-subscribe
this.route.queryParams.pipe(first()).subscribe(async (qParams) => {
// If there is an query parameter called 'org', set previousUrl to `/create-organization?org=paramValue`
if (qParams.org != null) {
const route = this.router.createUrlTree(["create-organization"], {
queryParams: { plan: qParams.org },
@@ -115,7 +116,11 @@ export class LoginComponent extends BaseLoginComponent implements OnInit {
this.routerService.setPreviousUrl(route.toString());
}
// Are they coming from an email for sponsoring a families organization
/**
* If there is a query parameter called 'sponsorshipToken', that means they are coming
* from an email for sponsoring a families organization. If so, then set the prevousUrl
* to `/setup/families-for-enterprise?token=paramValue`
*/
if (qParams.sponsorshipToken != null) {
const route = this.router.createUrlTree(["setup/families-for-enterprise"], {
queryParams: { token: qParams.sponsorshipToken },