diff --git a/src/main/java/com/example/sinitto/auth/service/KakaoTokenService.java b/src/main/java/com/example/sinitto/auth/service/KakaoTokenService.java index 53f00e72..949bb248 100644 --- a/src/main/java/com/example/sinitto/auth/service/KakaoTokenService.java +++ b/src/main/java/com/example/sinitto/auth/service/KakaoTokenService.java @@ -3,8 +3,8 @@ import com.example.sinitto.auth.dto.KakaoTokenResponse; import com.example.sinitto.auth.entity.KakaoToken; import com.example.sinitto.auth.repository.KakaoTokenRepository; +import com.example.sinitto.common.exception.InvalidJwtException; import com.example.sinitto.common.exception.NotFoundException; -import com.example.sinitto.common.exception.UnauthorizedException; import jakarta.transaction.Transactional; import org.springframework.stereotype.Service; @@ -40,7 +40,7 @@ public String getValidAccessTokenInServer(String email) { if (kakaoToken.isAccessTokenExpired()) { if (kakaoToken.isRefreshTokenExpired()) { - throw new UnauthorizedException("카카오 리프레쉬 토큰이 만료되었습니다. 카카오 재 로그인 필요"); + throw new InvalidJwtException("카카오 리프레쉬 토큰이 만료되었습니다. 카카오 재 로그인 필요"); } KakaoTokenResponse kakaoTokenResponse = kakaoApiService.refreshAccessToken(kakaoToken.getRefreshToken()); kakaoToken.updateKakaoToken(kakaoTokenResponse.accessToken(), kakaoTokenResponse.refreshToken(), kakaoTokenResponse.expiresIn(), kakaoTokenResponse.refreshTokenExpiresIn()); diff --git a/src/main/java/com/example/sinitto/auth/service/TokenService.java b/src/main/java/com/example/sinitto/auth/service/TokenService.java index c5db8744..f1cd8b69 100644 --- a/src/main/java/com/example/sinitto/auth/service/TokenService.java +++ b/src/main/java/com/example/sinitto/auth/service/TokenService.java @@ -20,7 +20,7 @@ @Service public class TokenService { - private static final long ACCESS_TEN_HOURS = 1000 * 60 * 60 * 10; + private static final long ACCESS_TEN_HOURS = 1000 * 60 * 5; private static final long REFRESH_SEVEN_DAYS = 1000 * 60 * 60 * 24 * 7; private final Key secretKey;