Skip to content

Commit f829323

Browse files
committed
feat(profile): authentication settings page can be without security images
* Now is possible to deploy user-profile without security images. * If the property enable_security_image is set to false, then the Profile->Settings->Authentication page will contain just enforce mfa functionality (without security images).
1 parent eebe920 commit f829323

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

apps/user-profile/src/app/pages/settings-page/settings-authorization/settings-authentication.component.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export class SettingsAuthenticationComponent implements OnInit, AfterViewInit {
6161

6262
ngOnInit(): void {
6363
this.loadingMfa = true;
64-
this.loadingImg = true;
6564
this.translate.onLangChange.subscribe(() => {
6665
this.translate
6766
.get('AUTHENTICATION.DELETE_IMG_DIALOG_TITLE')
@@ -90,8 +89,10 @@ export class SettingsAuthenticationComponent implements OnInit, AfterViewInit {
9089
console.error(e);
9190
this.loadingMfa = false;
9291
});
93-
94-
this.loadImage();
92+
this.displayImageBlock = this.store.get('mfa', 'enable_security_image') as boolean;
93+
if (this.displayImageBlock) {
94+
this.loadImage();
95+
}
9596
}
9697

9798
onAddImg(): void {
@@ -159,8 +160,8 @@ export class SettingsAuthenticationComponent implements OnInit, AfterViewInit {
159160
}
160161

161162
private loadImage(): void {
163+
this.loadingImg = true;
162164
const imgAttributeName = this.store.get('mfa', 'security_image_attribute') as string;
163-
this.displayImageBlock = this.store.get('mfa', 'enable_security_image') as boolean;
164165
this.attributesManagerService
165166
.getUserAttributeByName(this.store.getPerunPrincipal().userId, imgAttributeName)
166167
.subscribe(

0 commit comments

Comments
 (0)