diff --git a/apps/user-profile/src/app/pages/settings-page/settings-authorization/mfa-settings/mfa-settings.component.html b/apps/user-profile/src/app/pages/settings-page/settings-authorization/mfa-settings/mfa-settings.component.html index 8eb217cb6..4cce7a48a 100644 --- a/apps/user-profile/src/app/pages/settings-page/settings-authorization/mfa-settings/mfa-settings.component.html +++ b/apps/user-profile/src/app/pages/settings-page/settings-authorization/mfa-settings/mfa-settings.component.html @@ -1,20 +1,25 @@
- {{'AUTHENTICATION.MFA_TOGGLE' | customTranslate | translate}} - + - +
{ + this.mfaApiService.isMfaAvailable().subscribe({ + next: (isAvailable) => { this.mfaAvailable = isAvailable; if (isAvailable) { this.loadMfa(); @@ -58,11 +58,11 @@ export class MfaSettingsComponent implements OnInit { this.loadingMfa = false; } }, - (err) => { + error: (err) => { console.error(err); this.loadingMfa = false; - } - ); + }, + }); } /** @@ -86,8 +86,8 @@ export class MfaSettingsComponent implements OnInit { const enforceMfaAttributeName = this.store.get('mfa', 'enforce_mfa_attribute') as string; this.attributesManagerService .getUserAttributeByName(this.store.getPerunPrincipal().userId, enforceMfaAttributeName) - .subscribe( - (attr) => { + .subscribe({ + next: (attr) => { if (attr.value) { this.enforceMfa = true; this.toggle.toggle(); @@ -96,11 +96,11 @@ export class MfaSettingsComponent implements OnInit { } this.loadingMfa = false; }, - (e) => { + error: (e) => { console.error(e); this.loadingMfa = false; - } - ); + }, + }); } } @@ -109,16 +109,16 @@ export class MfaSettingsComponent implements OnInit { */ getCategoriesAndSettings(): void { this.loadingCategories = true; - this.mfaApiService.getCategories().subscribe( - (categories) => { + this.mfaApiService.getCategories().subscribe({ + next: (categories) => { this.categories = categories; this.getSettings(); }, - (err) => { + error: (err) => { console.error(err); this.loadingCategories = false; - } - ); + }, + }); } /** @@ -133,8 +133,8 @@ export class MfaSettingsComponent implements OnInit { this.showDetail = !this.showDetail; this.loadingCategories = false; } else { - this.mfaApiService.getSettings().subscribe( - (settings) => { + this.mfaApiService.getSettings().subscribe({ + next: (settings) => { if (settings.length !== 0) { if (settings.all) { this.allCategories = true; @@ -149,11 +149,11 @@ export class MfaSettingsComponent implements OnInit { this.showDetail = !this.showDetail; this.loadingCategories = false; }, - (err) => { + error: (err) => { console.error(err); this.loadingCategories = false; - } - ); + }, + }); } } @@ -380,8 +380,8 @@ export class MfaSettingsComponent implements OnInit { * @param enforceMfa turn on/off mfa for all services according to toggle */ changeEnforceMfa(enforceMfa: boolean): void { - this.mfaApiService.enforceMfaForAllServices(enforceMfa).subscribe( - () => { + this.mfaApiService.enforceMfaForAllServices(enforceMfa).subscribe({ + next: () => { if (enforceMfa) { this.enforceMfa = true; if (!this.toggle.checked) { @@ -396,15 +396,15 @@ export class MfaSettingsComponent implements OnInit { sessionStorage.removeItem('mfa_route'); this.loadingMfa = false; }, - (err) => { + error: (err) => { // when token is valid, but user is logged in without MFA -> enforce MFA if (err.error.error === 'MFA is required') { this.saveSettings(true); } else { this.loadingMfa = false; } - } - ); + }, + }); } /** @@ -413,22 +413,22 @@ export class MfaSettingsComponent implements OnInit { updateDetailSettings(): void { const body = sessionStorage.getItem('settings_mfa'); - this.mfaApiService.updateDetailSettings(body).subscribe( - () => { + this.mfaApiService.updateDetailSettings(body).subscribe({ + next: () => { this.unchangedSettings = true; this.unchangedEnforce = true; sessionStorage.removeItem('settings_mfa'); sessionStorage.removeItem('mfa_route'); this.loadingMfa = false; }, - (err) => { + error: (err) => { // when token is valid, but user is logged in without MFA -> enforce MFA if (err.error.error === 'MFA is required') { this.saveSettings(true); } else { this.loadingMfa = false; } - } - ); + }, + }); } } diff --git a/package-lock.json b/package-lock.json index a9432a446..bbb054880 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21551,16 +21551,6 @@ "color-support": "bin.js" } }, - "node_modules/npm/node_modules/colors": { - "version": "1.4.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/npm/node_modules/columnify": { "version": "1.6.0", "inBundle": true, @@ -21964,12 +21954,6 @@ "inBundle": true, "license": "MIT" }, - "node_modules/npm/node_modules/is-typedarray": { - "version": "1.0.0", - "dev": true, - "inBundle": true, - "license": "MIT" - }, "node_modules/npm/node_modules/isexe": { "version": "2.0.0", "inBundle": true, @@ -23012,12 +22996,6 @@ "node": ">=8" } }, - "node_modules/npm/node_modules/stringify-package": { - "version": "1.0.1", - "dev": true, - "inBundle": true, - "license": "ISC" - }, "node_modules/npm/node_modules/strip-ansi": { "version": "6.0.1", "inBundle": true, @@ -23074,26 +23052,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/npm/node_modules/typedarray-to-buffer": { - "version": "4.0.0", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "inBundle": true, - "license": "MIT" - }, "node_modules/npm/node_modules/unique-filename": { "version": "1.1.1", "inBundle": true, @@ -45206,12 +45164,6 @@ "version": "1.1.3", "bundled": true }, - "colors": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true - }, "columnify": { "version": "1.6.0", "bundled": true, @@ -45484,11 +45436,6 @@ "version": "1.0.1", "bundled": true }, - "is-typedarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, "isexe": { "version": "2.0.0", "bundled": true @@ -46194,11 +46141,6 @@ "strip-ansi": "^6.0.1" } }, - "stringify-package": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, "strip-ansi": { "version": "6.0.1", "bundled": true, @@ -46237,11 +46179,6 @@ "version": "2.0.0", "bundled": true }, - "typedarray-to-buffer": { - "version": "4.0.0", - "bundled": true, - "dev": true - }, "unique-filename": { "version": "1.1.1", "bundled": true,