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

Main merge #150

Merged
merged 3 commits into from
Apr 9, 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
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ public WrapLoginResDTO login(HttpServletResponse response, LoginReqDTO loginReqD

// header 생성
RefreshToken refreshToken = refreshTokenService.createRefreshToken(member);
String cutRefreshToken = JwtProvider.cutTokenPrefix(refreshToken.getToken());
Instant accessTokenExpiration = JwtProvider.getExpiration(accessToken);
Instant refreshTokenExpiration = JwtProvider.getExpiration(refreshToken.getToken());

HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.set(HttpHeaders.AUTHORIZATION, accessToken);

CookieUtil.addCookie(response, "refresh-token", cutRefreshToken, (int) refreshTokenExpiration.toEpochMilli());
CookieUtil.addCookie(response, "refresh-token", refreshToken.getToken(), (int) refreshTokenExpiration.toEpochMilli());

return WrapLoginResDTO.builder()
.headers(httpHeaders)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class JwtProvider {
private static String secretKey;
public static final String PREFIX = "Bearer ";
private static final Long HOUR = 1000L * 60 * 60;
private static final Long HOUR = 1000L * 60; // 1분으로 변경
private static final Long ACCESS_TOKEN_EXP_MS = HOUR; // 1시간
private static final Long REFRESH_TOKEN_EXP_MS = 24 * HOUR * 14; // 2주

Expand Down
Loading