From 78225cb1bf679428784a9e6942c43f1827f14cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=9D=B8=EC=A4=80?= <54973090+dlswns2480@users.noreply.github.com> Date: Sat, 7 Sep 2024 01:56:34 +0900 Subject: [PATCH] =?UTF-8?q?edit=20:=20=EB=A7=8C=EB=A3=8C=EA=B8=B0=EA=B0=84?= =?UTF-8?q?=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95=20(#154)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/com/pokit/auth/port/service/JwtTokenProvider.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/application/src/main/kotlin/com/pokit/auth/port/service/JwtTokenProvider.kt b/application/src/main/kotlin/com/pokit/auth/port/service/JwtTokenProvider.kt index f11df5a9..a8bfa8d1 100644 --- a/application/src/main/kotlin/com/pokit/auth/port/service/JwtTokenProvider.kt +++ b/application/src/main/kotlin/com/pokit/auth/port/service/JwtTokenProvider.kt @@ -19,9 +19,12 @@ class JwtTokenProvider( private val jwtProperty: JwtProperty, private val refreshTokenPort: RefreshTokenPort, ) : TokenProvider { + companion object { + private const val TO_DAY = 86400000 + } override fun createToken(userId: Long): Token { - val accessToken = generateToken(userId, jwtProperty.accessExpiryTime) - val refreshToken = generateToken(userId, jwtProperty.refreshExpiryTime) + val accessToken = generateToken(userId, jwtProperty.accessExpiryTime * TO_DAY) + val refreshToken = generateToken(userId, jwtProperty.refreshExpiryTime * TO_DAY) refreshTokenPort.deleteByUserId(userId) refreshTokenPort.persist(RefreshToken(userId, refreshToken))