From 6c223bd87ba09089572c4ab5ef91ab94bc4ca8b1 Mon Sep 17 00:00:00 2001 From: "Lee, yeeun" Date: Sat, 2 Nov 2024 22:06:09 +0900 Subject: [PATCH] =?UTF-8?q?:recycle:Refactor:Config=20=EB=B6=80=EB=B6=84?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/example/moyeothon/Config/SecurityConfig.java | 5 ++++- .../com/example/moyeothon/Config/Swagger/SwaggerConfig.java | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/example/moyeothon/Config/SecurityConfig.java b/src/main/java/com/example/moyeothon/Config/SecurityConfig.java index 8962d86..4fd668e 100644 --- a/src/main/java/com/example/moyeothon/Config/SecurityConfig.java +++ b/src/main/java/com/example/moyeothon/Config/SecurityConfig.java @@ -44,7 +44,10 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { .csrf(csrf -> csrf.disable()) .authorizeHttpRequests(authorizeRequests -> authorizeRequests - .requestMatchers("/", "/login**", "/oauth2/**", "/login", "/loginFailure", "/error", "/user/login").permitAll() // 일반 로그인 허용 + .requestMatchers("/", "/login**", "/oauth2/**", "/login", "/loginFailure", "/error", "/user/login","/swagger-ui.html", + "/swagger-ui/**", + "/v3/api-docs/**", + "/swagger-resources/**").permitAll() // 일반 로그인 허용 .requestMatchers("/user/kakao/**").authenticated() .anyRequest().permitAll() // 모든 요청 허용 ) diff --git a/src/main/java/com/example/moyeothon/Config/Swagger/SwaggerConfig.java b/src/main/java/com/example/moyeothon/Config/Swagger/SwaggerConfig.java index 54d1fbc..27ec567 100644 --- a/src/main/java/com/example/moyeothon/Config/Swagger/SwaggerConfig.java +++ b/src/main/java/com/example/moyeothon/Config/Swagger/SwaggerConfig.java @@ -32,7 +32,8 @@ public OpenAPI openAPI() { )) .addSecurityItem(new SecurityRequirement().addList(securitySchemeName)) .info(apiInfo()) - .servers(List.of(new Server().url(serverUrl))); + .servers(List.of(new Server().url(serverUrl), new Server().url("http://localhost:8080"))); + } private Info apiInfo() {