1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 05:43:41 +00:00

[SSO Auto Enroll] Auto Enroll status retrieval (#486)

* [SSO Auto Enroll] Auto Enroll status retrieval

* Fixed import order

* Updated object property
This commit is contained in:
Vincent Salucci
2021-09-15 12:54:44 -05:00
committed by GitHub
parent ee1ea922a9
commit da132217da
4 changed files with 27 additions and 5 deletions

View File

@@ -65,11 +65,13 @@ export class SetPasswordComponent extends BaseChangePasswordComponent {
// Automatic Enrollment Detection
if (this.identifier != null) {
const org = await this.userService.getOrganizationByIdentifier(this.identifier);
this.orgId = org?.id;
const policyList = await this.policyService.getAll(PolicyType.ResetPassword);
const policyResult = this.policyService.getResetPasswordPolicyOptions(policyList, this.orgId);
this.resetPasswordAutoEnroll = policyResult[1] && policyResult[0].autoEnrollEnabled;
try {
const response = await this.apiService.getOrganizationAutoEnrollStatus(this.identifier);
this.orgId = response.id;
this.resetPasswordAutoEnroll = response.resetPasswordEnabled;
} catch {
this.platformUtilsService.showToast('error', null, this.i18nService.t('errorOccurred'));
}
}
super.ngOnInit();