From ecc15222964c9ad3c8112468bb49ab7a76354f0f Mon Sep 17 00:00:00 2001 From: JeonHaeseung <414catherine@gmail.com> Date: Tue, 9 Jul 2024 21:57:46 +0900 Subject: [PATCH] =?UTF-8?q?[chore]=20=ED=85=8C=EC=8A=A4=ED=8A=B8=EC=9A=A9?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=9E=A0=EC=8B=9C=20=ED=86=A0=ED=81=B0=20?= =?UTF-8?q?=EB=A7=8C=EB=A3=8C=20=EC=8B=9C=EA=B0=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Backend/domain/auth/inmemory/entity/RefreshToken.java | 6 ++++-- .../java/Ness/Backend/domain/auth/jwt/JwtTokenProvider.java | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/Ness/Backend/domain/auth/inmemory/entity/RefreshToken.java b/src/main/java/Ness/Backend/domain/auth/inmemory/entity/RefreshToken.java index a9e9633..0a66438 100644 --- a/src/main/java/Ness/Backend/domain/auth/inmemory/entity/RefreshToken.java +++ b/src/main/java/Ness/Backend/domain/auth/inmemory/entity/RefreshToken.java @@ -10,7 +10,8 @@ @Getter @NoArgsConstructor -@RedisHash(value = "refreshToken", timeToLive = 60*60*24*14) +//@RedisHash(value = "refreshToken", timeToLive = 60*60*24*14) +@RedisHash(value = "refreshToken", timeToLive = 5) public class RefreshToken { /* Redis에 저장해서 RefreshToken이 유효한지 검증 */ @Id @Indexed @@ -27,6 +28,7 @@ public class RefreshToken { /* Redis에 저장해서 RefreshToken이 유효한 public RefreshToken(String jwtRefreshToken, String authKey) { this.jwtRefreshToken = jwtRefreshToken; this.authKey = authKey; - this.ttl = 1000L * 60 * 60 * 24 * 14; + //this.ttl = 1000L * 60 * 60 * 24 * 14; + this.ttl = 1000L * 5; } } \ No newline at end of file diff --git a/src/main/java/Ness/Backend/domain/auth/jwt/JwtTokenProvider.java b/src/main/java/Ness/Backend/domain/auth/jwt/JwtTokenProvider.java index 5bbcb55..65f5426 100644 --- a/src/main/java/Ness/Backend/domain/auth/jwt/JwtTokenProvider.java +++ b/src/main/java/Ness/Backend/domain/auth/jwt/JwtTokenProvider.java @@ -28,8 +28,9 @@ public class JwtTokenProvider { /* 토큰의 만료 시간 설정 * jwtAccessToken은 1시간, jwtRefreshToken은 1주 */ //private static final long JWT_EXPIRATION_TIME = 1000L * 60 * 60; //1시간 - private static final long JWT_EXPIRATION_TIME = 1000L * 60 * 60 * 24; //개발 테스트용: 하루 - private static final long REFRESH_TOKEN_EXPIRATION_TIME = 1000L * 60 * 60 * 24 * 14; + //private static final long REFRESH_TOKEN_EXPIRATION_TIME = 1000L * 60 * 60 * 24 * 14; //14일 + private static final long JWT_EXPIRATION_TIME = 1000L * 60 * 2; + private static final long REFRESH_TOKEN_EXPIRATION_TIME = 1000L * 60 * 5; private static final String AUTHORITIES_KEY = "auth";