Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

쿠키 설정 변경 #162

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
package kr.co.fastcampus.yanabada.common.jwt.filter;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import kr.co.fastcampus.yanabada.common.exception.JsonProcessFailedException;
import kr.co.fastcampus.yanabada.common.response.ResponseBody;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.authentication.BadCredentialsException;
Expand All @@ -21,8 +16,6 @@
@RequiredArgsConstructor
public class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint {

private final ObjectMapper objectMapper;

@Override
public void commence(
HttpServletRequest request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2Authentic
.getUserInfoEndpoint()
.getUserNameAttributeName();

log.info("registrationId={}", registrationId);
log.info("userNameAttributeName={}", userNameAttributeName);

Oauth2Attribute oauth2Attribute = Oauth2Attribute.of(
registrationId, userNameAttributeName, oauth2User.getAttributes()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,9 @@ private void setValueInCookie(
try {
ResponseCookie cookie = ResponseCookie
.from(key, URLEncoder.encode(value, "UTF-8"))
.secure(secure)
.secure(true)
.path("/")
.sameSite("None")
.build();
response.addHeader("Set-Cookie", cookie.toString());
} catch (UnsupportedEncodingException e) {
Expand Down
Loading