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:
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user