Skip to content

Commit

Permalink
fix: 원인 파악 완료 - #24
Browse files Browse the repository at this point in the history
- 크롬에서 쿠키 사용을 위해 sameSite, secure 설정
- 이 설정으로 인해 https만 허용됨
- FrontEnd의 localhost는 http
- 우회하기 위해 FrontEnd에서 Docker 사용 예정
  • Loading branch information
Dh3356 committed Feb 28, 2024
1 parent 6389ae2 commit 62c759e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
11 changes: 7 additions & 4 deletions src/main/java/org/mjulikelion/baker/config/CacheConfig.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package org.mjulikelion.baker.config;

//@Configuration
//@EnableCaching
//public class CacheConfig {
//}
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableCaching
public class CacheConfig {
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws
.sameSite("None")
.maxAge(ZERO)
.path("/")
.domain("localhost")
.build();
response.addHeader("Set-Cookie", cookie.toString());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.mjulikelion.baker.dto.response.ResponseDto;
import org.mjulikelion.baker.dto.response.introduce.IntroduceGetResponseData;
import org.mjulikelion.baker.service.introduce.IntroduceQueryService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
Expand All @@ -18,7 +19,7 @@ public class IntroduceController {
private final IntroduceQueryService introduceQueryService;

@GetMapping("/introduces")
//@Cacheable(value = "applicationByStudentId", key = "#studentId")
@Cacheable(value = "applicationByStudentId", key = "#studentId")
public ResponseEntity<ResponseDto<IntroduceGetResponseData>> getStudentIntroduce(
@RequestParam(value = "studentId")
@Pattern(regexp = APPLICATION_STUDENT_ID_PATTERN, message = "학번이 형식에 맞지 않습니다.") String studentId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public ResponseEntity<ResponseDto<Void>> login(AuthLoginRequestDto authLoginRequ
.sameSite("None").secure(true)
.httpOnly(true)
.path(ROOT_PATH)
.domain("localhost")
.build();
log.info("cookieString: {}", cookie);

Expand Down

0 comments on commit 62c759e

Please sign in to comment.