|
|
@ -29,6 +29,7 @@ export class TokenInterceptor implements HttpInterceptor {
|
|
|
|
errorMessage = `Error: ${error.error.message}`;
|
|
|
|
errorMessage = `Error: ${error.error.message}`;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//server error
|
|
|
|
//server error
|
|
|
|
|
|
|
|
console.log("Error: " + JSON.stringify(error));
|
|
|
|
if (error.status === 400){
|
|
|
|
if (error.status === 400){
|
|
|
|
switch (error.error.message) {
|
|
|
|
switch (error.error.message) {
|
|
|
|
case "Invalid refresh token!":
|
|
|
|
case "Invalid refresh token!":
|
|
|
@ -38,6 +39,7 @@ export class TokenInterceptor implements HttpInterceptor {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
|
|
|
|
errorMessage = `${error.error.message}. Error Code: ${error.status}.`;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -50,7 +52,7 @@ export class TokenInterceptor implements HttpInterceptor {
|
|
|
|
return this.handle401Error(request, next);
|
|
|
|
return this.handle401Error(request, next);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
errorMessage = `${error.error.message}. Error Code: ${error.status}.`;
|
|
|
|
errorMessage = `${error.error.message}. Error Code: ${error.status}.`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.snackBar.openSnackBar(errorMessage, "Ok", true);
|
|
|
|
this.snackBar.openSnackBar(errorMessage, "Ok", true);
|
|
|
|