Skip to content

Commit

Permalink
FIX : 모든페이지 권한허가, CORS 관련 도메인 추가(나래님 도메인)
Browse files Browse the repository at this point in the history
  • Loading branch information
juwum12 committed Apr 9, 2024
1 parent f64099e commit eac01d8
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions src/main/java/com/nawabali/nawabali/config/WebSecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
List.of(
"http://localhost:3000", "http://localhost:5500", "http://localhost:5000",
"http://127.0.0.1:3000", "http://127.0.0.1:5500", "http://127.0.0.1:5000",
"http://hhboard.shop", "https://hhboard.shop" // 프론트엔드 주소 추가 필요
"http://hhboard.shop", "https://hhboard.shop", "https://vercel-nu-lyart.vercel.app" // 프론트엔드 주소 추가 필요
)
);
configuration.setAllowedMethods(Collections.singletonList("*"));
Expand All @@ -92,26 +92,27 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti

http.authorizeHttpRequests((authorizeHttpRequests) ->
authorizeHttpRequests
.requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll() // resources 접근 허용 설정
.requestMatchers("/").permitAll() // 메인 페이지 요청 허가
.requestMatchers("/main.html").permitAll() // 메인 html페이지 요청 허가
.requestMatchers("/ping").permitAll() // 항상 200 OK 반환하는 health check 전용 API
.requestMatchers("/users/signup").permitAll()
.requestMatchers(HttpMethod.POST, "/users/login").permitAll()
.requestMatchers("/posts").permitAll()
.requestMatchers(HttpMethod.GET, "/posts/**").permitAll() // 게시글 상세 조회 허가
.requestMatchers("/users/test").permitAll()
.requestMatchers("/users/test1").permitAll()
.requestMatchers("/api/user/kakao/callback").permitAll()
.requestMatchers("/api/auth/**").permitAll()
.requestMatchers("/swagger/**").permitAll()
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll()
.requestMatchers("/api-test").permitAll()
.requestMatchers("/users/check-nickname").permitAll()
.requestMatchers("/email-verification").permitAll()
.requestMatchers("/ws-stomp/**").permitAll()
.requestMatchers("/chat/**").permitAll()
.anyRequest().authenticated() // 그 외 모든 요청 인증처리
.anyRequest().permitAll()
// .requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll() // resources 접근 허용 설정
// .requestMatchers("/").permitAll() // 메인 페이지 요청 허가
// .requestMatchers("/main.html").permitAll() // 메인 html페이지 요청 허가
// .requestMatchers("/ping").permitAll() // 항상 200 OK 반환하는 health check 전용 API
// .requestMatchers("/users/signup").permitAll()
// .requestMatchers(HttpMethod.POST, "/users/login").permitAll()
// .requestMatchers("/posts").permitAll()
// .requestMatchers(HttpMethod.GET, "/posts/**").permitAll() // 게시글 상세 조회 허가
// .requestMatchers("/users/test").permitAll()
// .requestMatchers("/users/test1").permitAll()
// .requestMatchers("/api/user/kakao/callback").permitAll()
// .requestMatchers("/api/auth/**").permitAll()
// .requestMatchers("/swagger/**").permitAll()
// .requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll()
// .requestMatchers("/api-test").permitAll()
// .requestMatchers("/users/check-nickname").permitAll()
// .requestMatchers("/email-verification").permitAll()
// .requestMatchers("/ws-stomp/**").permitAll()
// .requestMatchers("/chat/**").permitAll()
// .anyRequest().authenticated() // 그 외 모든 요청 인증처리
);

http.logout(logoutconfigurer->logoutconfigurer
Expand Down

0 comments on commit eac01d8

Please sign in to comment.