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

[Hotfix] - Refresh 토큰으로 재발급 요청시 NullPointException 해결, CORS config 빠르게 Cherry pick #78

Merged
merged 2 commits into from
Dec 4, 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
5 changes: 3 additions & 2 deletions src/main/java/com/palettee/global/configs/CorsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ public CorsConfigurationSource corsConfigurationSource(){
CorsConfiguration config = new CorsConfiguration();

config.setAllowCredentials(true);
config.setAllowedOrigins(List.of("http://localhost:3000", "https://palettee22.netlify.app", "https://palettee.site"));
config.setAllowedOrigins(List.of("http://localhost:3000", "https://palettee22.netlify.app", "https://www.palettee.site"));
config.addAllowedMethod("*");
config.setAllowedHeaders(List.of("*"));
config.setExposedHeaders(List.of("*"));

// 클라이언트에서 접근할 수 있도록 노출할 헤더를 명시
config.setExposedHeaders(List.of("Authorization", "Content-Type", "Cache-Control"));



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,12 @@ public TokenIssueResponse testIssueToken(
private String getRefreshTokenFromCookie(HttpServletRequest request) {
Cookie[] cookies = request.getCookies();

return Arrays.stream(cookies).parallel()
.filter(cookie -> cookie.getName().equals(REFRESH_TOKEN_COOKIE_KEY))
.map(Cookie::getValue)
.findFirst()
.orElse(null);
return cookies == null ? null :
Arrays.stream(cookies).parallel()
.filter(cookie -> cookie.getName().equals(REFRESH_TOKEN_COOKIE_KEY))
.map(Cookie::getValue)
.findFirst()
.orElse(null);
}


Expand Down
Loading