Skip to content

Commit

Permalink
Merge pull request #167 from beyond-sw-camp/fix/auth/login
Browse files Browse the repository at this point in the history
[Refactor] CORS 및 쿠키 저장 문제 해결 #166
  • Loading branch information
Aqulog authored Aug 12, 2024
2 parents b70ef43 + 495aeaa commit dcacb5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/gamja/tiggle/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public CorsFilter corsFilter() {
config.addAllowedOrigin("http://127.0.0.1");
config.addAllowedOrigin("http://localhost:8081");
config.addAllowedOrigin("http://localhost:8082");
config.addAllowedOrigin("http://www.tiggle.kro.kr.s3-website.ap-northeast-2.amazonaws.com");
config.addAllowedMethod("*");
config.addAllowedHeader("*");
config.setAllowCredentials(true);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/gamja/tiggle/config/filter/LoginFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ protected void successfulAuthentication(HttpServletRequest request,

Cookie loginCookie = new Cookie("AToken", token);
loginCookie.setHttpOnly(true);
loginCookie.setSecure(true);
loginCookie.setSecure(false);
loginCookie.setPath("/");
loginCookie.setMaxAge(60*60*1);
loginCookie.setMaxAge(60*60*24);

response.addCookie(loginCookie);
}
Expand Down

0 comments on commit dcacb5d

Please sign in to comment.