diff --git a/customer-apigateway-service/src/main/java/com/justpickup/customerapigatewayservice/handler/GlobalExceptionHandler.java b/customer-apigateway-service/src/main/java/com/justpickup/customerapigatewayservice/handler/GlobalExceptionHandler.java index b40813e..8c8b633 100644 --- a/customer-apigateway-service/src/main/java/com/justpickup/customerapigatewayservice/handler/GlobalExceptionHandler.java +++ b/customer-apigateway-service/src/main/java/com/justpickup/customerapigatewayservice/handler/GlobalExceptionHandler.java @@ -44,10 +44,10 @@ public class GlobalExceptionHandler implements ErrorWebExceptionHandler { exchange.getResponse().getHeaders().setContentType(MediaType.APPLICATION_JSON); responseBody.put("code", "INVALID"); responseBody.put("message", "Invalid Access Token"); - }else{ - exchange.getResponse().setStatusCode(HttpStatus.UNAUTHORIZED); + } else { + exchange.getResponse().setStatusCode(exchange.getResponse().getStatusCode()); exchange.getResponse().getHeaders().setContentType(MediaType.APPLICATION_JSON); - responseBody.put("code", "INVALID"); + responseBody.put("code", ex.getMessage()); } DataBuffer wrap = null; diff --git a/customer-apigateway-service/src/main/resources/application.yml b/customer-apigateway-service/src/main/resources/application.yml index ba88654..c3cb663 100644 --- a/customer-apigateway-service/src/main/resources/application.yml +++ b/customer-apigateway-service/src/main/resources/application.yml @@ -38,6 +38,7 @@ spring: - PUT - OPTIONS - DELETE + - PATCH allowedHeaders: '*' allow-credentials: true routes: @@ -57,6 +58,14 @@ spring: - AuthorizationHeaderFilter - RewritePath=/store-service/(?.*),/$\{segment} + - id: notification-service + uri: lb://NOTIFICATION-SERVICE + predicates: + - Path=/notification-service/** + filters: + - AuthorizationHeaderFilter + - RewritePath=/notification-service/(?.*),/$\{segment} + - id: user-service uri: lb://USER-SERVICE predicates: