Skip to content

Commit 78a1cf0

Browse files
committed
fix : 쿠키 오류 수정
1 parent cdbe911 commit 78a1cf0

File tree

3 files changed

+1
-6
lines changed

3 files changed

+1
-6
lines changed

src/main/java/com/dnd/reevserver/domain/member/controller/AuthController.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
public class AuthController {
2222
private final AuthService authService;
2323

24-
// todo : 헤더로 저장되는 AT 대신 RT로 할까?
2524
@Operation(summary = "AT로 진행, Authorization 헤더로 검사함, Bearer AT 형식")
2625
@GetMapping("/check")
2726
public ResponseEntity<Map<String, Boolean>> checkAuth(@RequestHeader(value = "Authorization", required = false) String authorization) {
@@ -46,8 +45,6 @@ public ResponseEntity<Void> reissueToken(@CookieValue(value = "refresh_token", r
4645

4746
ReissueResponseDto reissuedToken = authService.reissueToken(refreshToken);
4847

49-
50-
5148
ResponseCookie refreshCookie = CookieUtils.createReissueCookie(
5249
"refresh_token",
5350
reissuedToken.getRefreshToken(),

src/main/java/com/dnd/reevserver/global/config/security/SecurityConfig.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ protected CorsConfigurationSource corsConfigurationSource() {
8383
config.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"));
8484
config.setAllowedHeaders(List.of("Authorization", "Content-Type", "Access-Control-Allow-Headers", "Access-Control-Expose-Headers", "_retry"));
8585

86-
config.addExposedHeader("Authorization"); //프론트에서 해당 헤더를 읽을 수 있게
87-
config.setExposedHeaders(List.of("Set-Cookie"));
86+
config.setExposedHeaders(List.of("Set-Cookie", "Authorization"));
8887
config.setAllowCredentials(true);
8988

9089
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();

src/main/java/com/dnd/reevserver/global/jwt/handler/OAuth2SuccessHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import jakarta.servlet.http.HttpSession;
1313
import lombok.RequiredArgsConstructor;
1414
import org.springframework.http.HttpHeaders;
15-
import org.springframework.http.ResponseCookie;
1615
import org.springframework.security.core.Authentication;
1716
import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
1817
import org.springframework.stereotype.Component;

0 commit comments

Comments
 (0)