|
|
@ -27,14 +27,18 @@ export class TokenInterceptor implements HttpInterceptor {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//server error;
|
|
|
|
//server error;
|
|
|
|
if (error.status === 401) {
|
|
|
|
if (error.status === 401) {
|
|
|
|
|
|
|
|
var urlSplit : string[] = error.url.split("/");
|
|
|
|
return this.handle401Error(request, next);
|
|
|
|
if (urlSplit[3] === "users" && urlSplit[5] === "update"){
|
|
|
|
|
|
|
|
errorMessage = "Das aktuelle Passwort ist inkorrekt.";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return this.handle401Error(request, next);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
errorMessage = `Error Code: ${error.status}\nMessage: ${error.message}`;
|
|
|
|
errorMessage = `Error Code: ${error.status}\nMessage: ${error.message}.`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.snackBar.openSnackBar(errorMessage, "Ok", true);
|
|
|
|
this.snackBar.openSnackBar(errorMessage, "Ok", true);
|
|
|
|
//return throwError(errorMessage);
|
|
|
|
return throwError(errorMessage);
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|