Skip to content

Commit 95e3fd1

Browse files
seongjae6751Choi-JJunho
authored andcommitted
feature: 리프레시 토큰 만료 기한을 14일에서 20초로 변경 (#431)
1 parent de58837 commit 95e3fd1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package in.koreatech.koin.domain.user.model;
22

3-
import java.util.concurrent.TimeUnit;
4-
53
import org.springframework.data.annotation.Id;
64
import org.springframework.data.redis.core.RedisHash;
75
import org.springframework.data.redis.core.TimeToLive;
@@ -12,14 +10,14 @@
1210
@RedisHash("refreshToken")
1311
public class UserToken {
1412

15-
private static final long REFRESH_TOKEN_EXPIRE_DAY = 14L;
13+
private static final long REFRESH_TOKEN_EXPIRE_SECONDS = 20L;
1614

1715
@Id
1816
private Integer id;
1917

2018
private final String refreshToken;
2119

22-
@TimeToLive(unit = TimeUnit.DAYS)
20+
@TimeToLive
2321
private final Long expiration;
2422

2523
private UserToken(Integer id, String refreshToken, Long expiration) {
@@ -29,6 +27,6 @@ private UserToken(Integer id, String refreshToken, Long expiration) {
2927
}
3028

3129
public static UserToken create(Integer userId, String refreshToken) {
32-
return new UserToken(userId, refreshToken, REFRESH_TOKEN_EXPIRE_DAY);
30+
return new UserToken(userId, refreshToken, REFRESH_TOKEN_EXPIRE_SECONDS);
3331
}
3432
}

0 commit comments

Comments
 (0)