Skip to content

Commit

Permalink
Update LoginSuccessHandler.java
Browse files Browse the repository at this point in the history
HeeSung98 authored Nov 28, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 5010cde commit 04d771d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -44,14 +44,14 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
result = result.replace("}", ", \"token\": \"" + token + "\"}");

Cookie cookieToken = new Cookie("token", token);
cookieToken.setHttpOnly(true); // JavaScript를 통한 쿠키 접근을 막기 위해 사용
cookieToken.setHttpOnly(false); // JavaScript를 통한 쿠키 접근을 막기 위해 사용
cookieToken.setMaxAge(3 * 60 * 60);
cookieToken.setSecure(true);
response.addCookie(cookieToken);

String userinfo = authUserDTO.getEmail() + "|" + authUserDTO.getName() + "|" + authUserDTO.getImage();
Cookie cookieUserinfo = new Cookie("userinfo", userinfo);
cookieUserinfo.setHttpOnly(true);
cookieUserinfo.setHttpOnly(false);
cookieUserinfo.setSecure(true);
cookieUserinfo.setMaxAge(3 * 60 * 60);
response.addCookie(cookieUserinfo);

0 comments on commit 04d771d

Please sign in to comment.