Skip to content

Commit

Permalink
feature: 리프레시 토큰 만료 기한 14일로 원상 복구
Browse files Browse the repository at this point in the history
  • Loading branch information
seongjae6751 committed Apr 16, 2024
1 parent d524818 commit 74cb3ec
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package in.koreatech.koin.domain.user.model;

import java.util.concurrent.TimeUnit;

import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.RedisHash;
import org.springframework.data.redis.core.TimeToLive;
Expand All @@ -10,14 +12,14 @@
@RedisHash("refreshToken")
public class UserToken {

private static final long REFRESH_TOKEN_EXPIRE_SECONDS = 20L;
private static final long REFRESH_TOKEN_EXPIRE_DAY = 14L;

@Id
private Integer id;

private final String refreshToken;

@TimeToLive
@TimeToLive(unit = TimeUnit.DAYS)
private final Long expiration;

private UserToken(Integer id, String refreshToken, Long expiration) {
Expand All @@ -27,6 +29,6 @@ private UserToken(Integer id, String refreshToken, Long expiration) {
}

public static UserToken create(Integer userId, String refreshToken) {
return new UserToken(userId, refreshToken, REFRESH_TOKEN_EXPIRE_SECONDS);
return new UserToken(userId, refreshToken, REFRESH_TOKEN_EXPIRE_DAY);
}
}

0 comments on commit 74cb3ec

Please sign in to comment.