feat: sameorigin 설정

This commit is contained in:
박정민 2024-07-31 13:02:33 +09:00
parent 6dd847f440
commit 47d8649057
2 changed files with 6 additions and 3 deletions

View File

@ -66,8 +66,7 @@ public class QnaServiceImpl implements QnaService{
findQna.setTitle(qnaRequestDto.getTitle()); findQna.setTitle(qnaRequestDto.getTitle());
findQna.setContent(qnaRequestDto.getContent()); findQna.setContent(qnaRequestDto.getContent());
qnaRepository.save(findQna); qnaRepository.save(findQna);
return QnaResponseDto.toEntity(findQna); return QnaResponseDto.toEntity(findQna);

View File

@ -102,8 +102,12 @@ public class UserController {
refreshCookie.setPath("/"); refreshCookie.setPath("/");
refreshCookie.setHttpOnly(true); refreshCookie.setHttpOnly(true);
// refreshCookie.setSecure(true); // HTTPS에서만 전송되도록 설정 // refreshCookie.setSecure(true); // HTTPS에서만 전송되도록 설정
// refreshCookie.setSameSite(Cookie.SameSite.NONE); // Cross-Origin 요청에 대해 모두 전송 //r/efreshCookie.setSameSite(Cookie.SameSite.NONE); // Cross-Origin 요청에 대해 모두 전송
//refreshCookie.setSameSite("None"); // Cross-Origin 요청에 대해 모두 전송
String cookieHeader = String.format("refresh-token=%s; Path=/; HttpOnly; Secure; SameSite=None", refreshToken);
response.setHeader("Set-Cookie", cookieHeader);
// refreshCookie.setSameSite("None"); // Cross-Origin 요청에 대해 모두 전송
response.addCookie(refreshCookie); response.addCookie(refreshCookie);