From 9469783d432d9d53eafe5ec0c0b4baa78af2510d Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Mon, 4 Jul 2022 22:04:55 +0200 Subject: feat: custom msg upon 401 response closes #4768 --- client/src/app/shared/shared-main/auth/auth-interceptor.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts b/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts index 51248c7b2..7daf31a98 100644 --- a/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts +++ b/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts @@ -61,8 +61,8 @@ export class AuthInterceptor implements HttpInterceptor { return req.clone({ headers: req.headers.set('Authorization', authHeaderValue) }) } - private handleNotAuthenticated (err: HttpErrorResponse, path = '/login'): Observable { - this.router.navigateByUrl(path) + private handleNotAuthenticated (err: HttpErrorResponse): Observable { + this.router.navigate([ '/404' ], { state: { obj: err }, skipLocationChange: true }) return of(err.message) } } -- cgit v1.2.3