Skip to content

Commit

Permalink
Fix: SuccessHandler 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongho427 committed May 5, 2024
1 parent 3779e40 commit b20be7d
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ public void onAuthenticationSuccess(HttpServletRequest request, HttpServletRespo
//String token = jwtUtil.createJwt(username, role, 60*60*60L);
String token = jwtUtil.createJwt(id, role, 60*60*60L);

response.addCookie(createCookie("Authorization", token));
response.sendRedirect("http://localhost:3000");
/*response.addCookie(createCookie("Authorization", token));
response.sendRedirect("http://localhost:3000");*/

// HTTP 응답에 토큰 값 추가
response.setHeader("Authorization", "Bearer " + token);
response.setStatus(HttpServletResponse.SC_OK);
response.getWriter().flush();
}

private Cookie createCookie(String key, String value) {
Expand Down

0 comments on commit b20be7d

Please sign in to comment.