Skip to content

Commit

Permalink
Deploy : Jwt refreshing cookie fix
Browse files Browse the repository at this point in the history
  • Loading branch information
404-not-foundl committed Mar 28, 2024
1 parent 0d77d74 commit 9dfd395
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
import java.util.List;

@Component
public class JwtAuthenticationFilterFactory extends AbstractGatewayFilterFactory<JwtAuthenticationFilterFactory.Config> {
public class JwtAuthenticationFilter extends AbstractGatewayFilterFactory<JwtAuthenticationFilter.Config> {

@Autowired
private JwtManager jwtManager;

public JwtAuthenticationFilterFactory() {
public JwtAuthenticationFilter() {
super(Config.class);
}

public static class Config {
// 필터 구성을 위한 설정 클래스입니다.
}
public static class Config {}

@Override
public GatewayFilter apply(Config config) {
return (exchange, chain) -> jwtManager.checkAccessToken(exchange)
.flatMap(internalId -> {
if ("null".equals(internalId)) {
System.out.println("SUCCESS");
exchange.getResponse().setStatusCode(HttpStatus.UNAUTHORIZED);
return exchange.getResponse().setComplete();
} else {
System.out.println("FAIL");
exchange.getRequest().mutate()
.header(jwtManager.INTERNAL_ID_HEADER, internalId)
.header(jwtManager.SECRET_KEY_HEADER, "fastand6")
Expand Down

0 comments on commit 9dfd395

Please sign in to comment.