From e4d39b6edc36aebb11f54e39782e2b80cd6239ce Mon Sep 17 00:00:00 2001 From: Amit Sengar Date: Tue, 5 Jul 2022 16:42:36 +0530 Subject: [PATCH] Default public home redirection stopped: Fix3 --- src/app/services/app-interceptor.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/services/app-interceptor.service.ts b/src/app/services/app-interceptor.service.ts index fbb12addf..561ce4e0a 100755 --- a/src/app/services/app-interceptor.service.ts +++ b/src/app/services/app-interceptor.service.ts @@ -5,6 +5,7 @@ import { ConfigurationsService, AuthKeycloakService } from '@sunbird-cb/utils' import { catchError } from 'rxjs/operators' import { MatSnackBar } from '@angular/material/snack-bar' import { NOTIFICATION_TIME } from '@sunbird-cb/collection/src/lib/_common/ck-editor/constants/constant' +import { Router } from '@angular/router' // import 'rxjs/add/operator/do' @Injectable({ @@ -15,6 +16,7 @@ export class AppInterceptorService implements HttpInterceptor { private configSvc: ConfigurationsService, private snackBar: MatSnackBar, private authSvc: AuthKeycloakService, + private router: Router, @Inject(LOCALE_ID) private locale: string, ) { } intercept(req: HttpRequest, next: HttpHandler): Observable> { @@ -89,7 +91,8 @@ export class AppInterceptorService implements HttpInterceptor { // window.location.href = error.error.redirectUrl + `?q=${pageName} ` // } if (!window.location.href.includes('/public/home')) { - window.location.href = '/public/home' + this.router.navigate(['public', 'home']) + // window.location.href = '/public/home' } // this.authSvc.force_logout() break