WEB-233: Improve the OIDC integration with 2FA (#2616)

This commit is contained in:
AllsVeam
2025-09-01 13:55:35 -06:00
committed by GitHub
parent 801dd3fdfe
commit 6ee9f4d4d2
66 changed files with 4425 additions and 135 deletions
@@ -24,6 +24,10 @@ import { MatIcon } from '@angular/material/icon';
import { MatLine } from '@angular/material/grid-list';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
/** Environment Configuration and Zitadel*/
import { environment } from '../../../../environments/environment';
import { AuthService } from 'app/zitadel/auth.service';
/**
* Sidenav component.
*/
@@ -82,7 +86,8 @@ export class SidenavComponent implements OnInit, AfterViewInit {
private authenticationService: AuthenticationService,
private settingsService: SettingsService,
private configurationWizardService: ConfigurationWizardService,
private popoverService: PopoverService
private popoverService: PopoverService,
private authService: AuthService
) {
this.userActivity = JSON.parse(localStorage.getItem('mifosXLocation'));
}
@@ -100,7 +105,11 @@ export class SidenavComponent implements OnInit, AfterViewInit {
* Logs out the authenticated user and redirects to login page.
*/
logout() {
this.authenticationService.logout().subscribe(() => this.router.navigate(['/login'], { replaceUrl: true }));
if (!environment.OIDC.oidcServerEnabled) {
this.authenticationService.logout().subscribe(() => this.router.navigate(['/login'], { replaceUrl: true }));
} else {
this.authService.logout();
}
}
/**
@@ -41,6 +41,10 @@ import { NotificationsTrayComponent as NotificationsTrayComponent_1 } from '../.
import { ThemeToggleComponent } from '../../../shared/theme-toggle/theme-toggle.component';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
/** Environment Configuration and Zitadel*/
import { environment } from '../../../../environments/environment';
import { AuthService } from 'app/zitadel/auth.service';
/**
* Toolbar component.
*/
@@ -103,7 +107,8 @@ export class ToolbarComponent implements OnInit, AfterViewInit, AfterContentChec
private popoverService: PopoverService,
private configurationWizardService: ConfigurationWizardService,
private dialog: MatDialog,
private changeDetector: ChangeDetectorRef
private changeDetector: ChangeDetectorRef,
private authService: AuthService
) {}
/**
@@ -140,10 +145,11 @@ export class ToolbarComponent implements OnInit, AfterViewInit, AfterContentChec
* Logs out the authenticated user and redirects to login page.
*/
logout() {
this.authenticationService.logout().subscribe(() => {
this.notificationsTray.destroy();
this.router.navigate(['/login'], { replaceUrl: true });
});
if (!environment.OIDC.oidcServerEnabled) {
this.authenticationService.logout().subscribe(() => this.router.navigate(['/login'], { replaceUrl: true }));
} else {
this.authService.logout();
}
}
/**