1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-05 10:03:21 +00:00

Add sponsorship pre validate to families redeem page (#1315)

* Add sponsorship pre validate to families redeem page

* Update messaging

* update jslib
This commit is contained in:
Matt Gibson
2021-11-24 14:31:16 -06:00
committed by GitHub
parent 9cc7dfb884
commit 6ec22a9408
4 changed files with 12 additions and 4 deletions

View File

@@ -6,7 +6,10 @@
<i class="fa fa-spinner fa-spin fa-2x text-muted" title="{{'loading' | i18n}}" aria-hidden="true"></i>
<span class="sr-only">{{'loading' | i18n}}</span>
</div>
<form #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate *ngIf="!loading">
<div *ngIf="!loading && badToken" class="mt-5 d-flex justify-content-center">
<span>{{'badToken' | i18n}}</span>
</div>
<form #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate *ngIf="!loading && !badToken">
<p>
<span>{{'acceptBitwardenFamiliesHelp' | i18n}}</span>
</p>

View File

@@ -55,6 +55,7 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit {
@ViewChild('deleteOrganizationTemplate', { read: ViewContainerRef, static: true }) deleteModalRef: ViewContainerRef;
loading = true;
badToken = false;
formPromise: Promise<any>;
token: string;
@@ -89,6 +90,7 @@ export class FamiliesForEnterpriseSetupComponent implements OnInit {
this.token = qParams.token;
await this.syncService.fullSync(true);
this.badToken = !await this.apiService.postPreValidateSponsorshipToken(this.token);
this.loading = false;
this.existingFamilyOrganizations = (await this.userService.getAllOrganizations())