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

[refactor #84] JWT 토큰 만료시간 변경 #85

Merged
merged 2 commits into from
Aug 23, 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 @@ -39,7 +39,7 @@
public class TokenProvider {

private static final String ROLE_KEY = "ROLE";
private static final long ACCESS_TOKEN_EXPIRE_TIME = 1000 * 60 * 30L;
private static final long ACCESS_TOKEN_EXPIRE_TIME = 1000 * 60 * 90L;
private static final long REFRESH_TOKEN_EXPIRE_TIME = 1000 * 60 * 60 * 24L;
private final MemberRepository memberRepository;
private final RedisUtil redisUtil;
Expand Down Expand Up @@ -99,8 +99,6 @@ public Authentication getAuthentication(String token) {
return new UsernamePasswordAuthenticationToken(principal, token, authorities);
}

// TODO : AccessToken 재발급 구현

public boolean validateToken(String token, Date date) {
if (!StringUtils.hasText(token)) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ void setUp() {
this.authInfo = AuthInfo.of("김회원", "kakao123/daum.net", "ROLE_USER");
}

@DisplayName("만료일이 30분인 토큰이 생성된다.")
@DisplayName("만료일이 1시간 30분인 토큰이 생성된다.")
@Test
void generateAccessToken() {
// given
Date now = new Date();
long expectedExpirationTime = now.getTime() + 30 * 60 * 1000;
long expectedExpirationTime = now.getTime() + 90 * 60 * 1000;

CustomOauth2User authentication = new CustomOauth2User(authInfo);

Expand Down
Loading