|
|
|
@ -29,12 +29,19 @@ export class TokenInterceptor implements HttpInterceptor {
|
|
|
|
|
errorMessage = `Error: ${error.error.message}`;
|
|
|
|
|
} else {
|
|
|
|
|
//server error
|
|
|
|
|
/*if (error.status === 400){
|
|
|
|
|
if (error.status === 400){
|
|
|
|
|
switch (error.error.message) {
|
|
|
|
|
case "Invalid refresh token!":
|
|
|
|
|
this.authService.logout();
|
|
|
|
|
errorMessage = "Die aktuelle Sitzung ist abgelaufen. Bitte loggen sie sich erneut ein."
|
|
|
|
|
this.router.navigate(["/login"], { queryParams: { returnUrl: this.router.routerState.snapshot.url } });
|
|
|
|
|
} else*/
|
|
|
|
|
console.log(JSON.stringify(error.message) + JSON.stringify(error.error));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
if (error.status === 401) {
|
|
|
|
|
var urlSplit : string[] = error.url.split("/");
|
|
|
|
|
if (urlSplit[3] === "users" && urlSplit[5] === "update"){ // Allow user pw updates to be processed correctly
|
|
|
|
|