Merge pull request #17174 from abpframework/auto-merge/rel-7-3/2081

Merge branch dev with rel-7.3
pull/17179/head
Mahmut Gundogdu 2 years ago committed by GitHub
commit 41ff476205
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,8 +1,9 @@
import {
import {
AuthService,
HttpErrorReporterService,
LocalizationParam,
RouterEvents,
SessionStateService,
} from '@abp/ng.core';
import { HttpErrorResponse } from '@angular/common/http';
import {
@ -83,7 +84,9 @@ export class ErrorHandler {
protected cfRes: ComponentFactoryResolver;
protected rendererFactory: RendererFactory2;
protected httpErrorConfig: HttpErrorConfig;
protected sessionStateService: SessionStateService;
private authService: AuthService;
constructor(protected injector: Injector) {
this.httpErrorReporter = injector.get(HttpErrorReporterService);
@ -93,6 +96,7 @@ export class ErrorHandler {
this.rendererFactory = injector.get(RendererFactory2);
this.httpErrorConfig = injector.get('HTTP_ERROR_CONFIG');
this.authService = this.injector.get(AuthService);
this.sessionStateService = this.injector.get(SessionStateService);
this.listenToRestError();
this.listenToRouterError();
@ -142,6 +146,7 @@ export class ErrorHandler {
};
if (err instanceof HttpErrorResponse && err.headers.get('Abp-Tenant-Resolve-Error')) {
this.sessionStateService.setTenant(null)
this.authService.logout().subscribe();
return;
}

Loading…
Cancel
Save