Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/issue-113 #115

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ public GatewayFilter apply(Config config) {
return (exchange, chain) -> {
ServerHttpRequest request = exchange.getRequest();

if (request.getHeaders().containsKey(ACCESS_AUTHORIZATION_HEADER)) {
String accessToken = request.getHeaders().get(ACCESS_AUTHORIZATION_HEADER).get(0);
String accessToken = request.getHeaders().get(ACCESS_AUTHORIZATION_HEADER).get(0);
log.info("accessToken = {}", accessToken);

if (isJwtValid(accessToken)) {
log.info("AccessToken 인가받은 사용자입니다.");
return chain.filter(exchange);
}
if (StringUtils.hasText(accessToken) && isJwtValid(accessToken)) {
return chain.filter(exchange);
}

String refreshToken = request.getHeaders().get(REFRESH_AUTHORIZATION_HEADER).get(0);
Expand Down
6 changes: 3 additions & 3 deletions backend/apigateway-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ spring:
- Method=GET
filters:
- AuthFilter
- id: chatting-service # chatting-service
uri: lb://CHATTING-SERVICE
- id: chatroom-service # chatroom-service
uri: lb://CHATROOM-SERVICE
predicates:
- Path=/chatting-service/**
- Path=/chatroom-service/**
- Method=POST, GET
filters:
- AuthFilter