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