mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[ADF-3685] Close all dialog when redirect after 401 to demo shell
This commit is contained in:
parent
e2cf8655d8
commit
7f448d78d1
@ -18,6 +18,7 @@
|
||||
import { Component, ViewEncapsulation, OnInit } from '@angular/core';
|
||||
import { AuthenticationService, AlfrescoApiService, PageTitleService } from '@alfresco/adf-core';
|
||||
import { Router } from '@angular/router';
|
||||
import { MatDialog } from '@angular/material';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
@ -30,7 +31,8 @@ export class AppComponent implements OnInit {
|
||||
constructor(private pageTitleService: PageTitleService,
|
||||
private alfrescoApiService: AlfrescoApiService,
|
||||
private authenticationService: AuthenticationService,
|
||||
private router: Router) {
|
||||
private router: Router,
|
||||
private dialogRef: MatDialog) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@ -39,6 +41,7 @@ export class AppComponent implements OnInit {
|
||||
this.alfrescoApiService.getInstance().on('error', (error) => {
|
||||
if (error.status === 401) {
|
||||
if (!this.authenticationService.isLoggedIn()) {
|
||||
this.dialogRef.closeAll();
|
||||
this.router.navigate(['/login']);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user