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() {