Skip to content

Commit a796c8b

Browse files
committed
fix : /login에서 발생하는 Headers에 대한 CORS 수정
1 parent 274da0b commit a796c8b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/main/java/leets/reminiscence/global/config/SecurityConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
6363
// 아이콘, css, js 관련
6464
// 기본 페이지, css, image, js 하위 폴더에 있는 자료들은 모두 접근 가능, h2-console에 접근 가능
6565
.antMatchers("/","/css/**","/images/**","/js/**","/favicon.ico","/h2-console/**").permitAll()
66-
.antMatchers("/sign-up").permitAll() // 회원가입 접근git 가능
66+
.antMatchers("/sign-up").permitAll() // 회원가입 접근 가능
6767
.antMatchers(HttpMethod.OPTIONS, "/api/**").permitAll()
6868
.antMatchers("/post").permitAll() // post 접근 가능
6969
.antMatchers("/post/{id}").permitAll() // post id 정보 접근 가능

src/main/java/leets/reminiscence/global/config/WebConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public void addCorsMappings(final CorsRegistry registry) {
1212
.allowedOrigins("http://localhost:3000", "http://localhost:8080")
1313
.allowedMethods("GET", "POST", "PUT", "DELETE")
1414
.allowCredentials(true)
15-
.maxAge(3000);
15+
.exposedHeaders("Authorization", "Authorization-refresh")
16+
.maxAge(3600);
1617
}
1718
}

0 commit comments

Comments
 (0)