1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

refresh token and UI when license updated

This commit is contained in:
Kyle Spearrin
2019-01-24 08:54:33 -05:00
parent a18e7ab2da
commit eb99fe58dd
3 changed files with 35 additions and 7 deletions

View File

@@ -38,12 +38,17 @@ export class UpdateLicenseComponent {
const fd = new FormData();
fd.append('license', files[0]);
let updatePromise: Promise<any> = null;
if (this.organizationId == null) {
this.formPromise = this.apiService.postAccountLicense(fd);
updatePromise = this.apiService.postAccountLicense(fd);
} else {
this.formPromise = this.apiService.postOrganizationLicenseUpdate(this.organizationId, fd);
updatePromise = this.apiService.postOrganizationLicenseUpdate(this.organizationId, fd);
}
this.formPromise = updatePromise.then(() => {
return this.apiService.refreshIdentityToken();
});
await this.formPromise;
this.analytics.eventTrack.next({ action: 'Updated License' });
this.toasterService.popAsync('success', null, this.i18nService.t('updatedLicense'));