diff --git a/src/app/helper/token.interceptor.ts b/src/app/helper/token.interceptor.ts index 9ea99ba..835a45a 100644 --- a/src/app/helper/token.interceptor.ts +++ b/src/app/helper/token.interceptor.ts @@ -22,13 +22,15 @@ export class TokenInterceptor implements HttpInterceptor { return next.handle(request).pipe(catchError((error: HttpErrorResponse) => { let errorMessage = ''; if (error.error instanceof ErrorEvent) { - //client error; + //client error + errorMessage = `Error: ${error.error.message}`; } else { - //server error; + //server error + if (error.status === 401) { - var urlSplit : string[] = error.url.split("/"); - if (urlSplit[3] === "users" && urlSplit[5] === "update"){ + var urlSplit : string[] = error.url.split("/"); + if (urlSplit[3] === "users" && urlSplit[5] === "update"){ // Allow user pw updates to be processed correctly errorMessage = "Das aktuelle Passwort ist inkorrekt."; } else { return this.handle401Error(request, next);