Skip to content

Commit

Permalink
fix: 로그인 시 access token 쿠키의 name access-token으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
bflykky committed Aug 6, 2024
1 parent 09223c5 commit 0accf70
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class OAuth2LoginSuccessHandler implements AuthenticationSuccessHandler {
private Long REFRESH_TOKEN_VALIDITY_IN_SECONDS;
@Value("${jwt.temp-member-info-validity-in-seconds}")
private Long TEMP_MEMBER_INFO_VALIDITY_IN_SECONDS;
private static final String AUTHORIZATION_HEADER = "Authorization";
private static final String ACCESS_TOKEN_KEY = "access-token";
private static final String REFRESH_TOKEN_KEY = "refresh-token";
private static final String TEMP_MEMBER_INFO_KEY = "temp-member-info";
private static final String FRONTEND_BASE_URL = "http://localhost:3000";
Expand Down Expand Up @@ -71,7 +71,7 @@ private void handleExistingMemberLogin(HttpServletRequest request, HttpServletRe

// 로그인 성공 처리를 위해 access token, refresh token 발급
String accessToken = jwtUtils.createJwt(member.getEmail(), role, ACCESS_TOKEN_VALIDITY_IN_SECONDS);
CookieUtils.addCookie(response, AUTHORIZATION_HEADER, accessToken, ACCESS_TOKEN_VALIDITY_IN_SECONDS.intValue());
CookieUtils.addCookie(response, ACCESS_TOKEN_KEY, accessToken, ACCESS_TOKEN_VALIDITY_IN_SECONDS.intValue());

String refreshToken = jwtUtils.createJwt(member.getEmail(), role, REFRESH_TOKEN_VALIDITY_IN_SECONDS);
refreshTokenService.saveRefreshToken(member.getId(), refreshToken);
Expand Down

0 comments on commit 0accf70

Please sign in to comment.