Skip to content

Commit

Permalink
[chore] token 만료시간 설정 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
unanchoi committed Jan 24, 2024
1 parent b2cb511 commit cde59d7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.pophory.pophorydomain.member.infrastructure.MemberJpaRepository;
import jakarta.persistence.EntityNotFoundException;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -20,9 +21,12 @@
@Service
@RequiredArgsConstructor
public class SocialService {

protected static final Long ACCESS_TOKEN_EXPIRATION_TIME = 60 * 60 * 1000 * 2L; // 2시간
protected static final Long REFRESH_TOKEN_EXPIRATION_TIME = 60 * 60 * 1000 * 24 * 14L; // 2주

@Value("${jwt.access-token.expiration-time}")
private long ACCESS_TOKEN_EXPIRATION_TIME;

@Value("${jwt.refresh-token.expiration-time}")
private long REFRESH_TOKEN_EXPIRATION_TIME; // 2주

private final JwtTokenProvider jwtTokenProvider;
private final MemberJpaRepository memberJpaRepository;
Expand Down
4 changes: 4 additions & 0 deletions pophory-api/src/main/resources/application-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ spring:

jwt:
secret: ${JWT_SECRET}
access-token:
expiration-time: 1200000
refresh-token:
expiration-time: 1209600000

sentry:
dsn: ${SENTRY_DSN}
Expand Down
4 changes: 4 additions & 0 deletions pophory-api/src/main/resources/application-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ spring:

jwt:
secret: ${JWT_SECRET}
access-token:
expiration-time: 7200000
refresh-token:
expiration-time: 1209600000

jwt.APPLE_URL: ${APPLE_URL}
jwt.KAKAO_URL: ${KAKAO_URL}
Expand Down
4 changes: 4 additions & 0 deletions pophory-api/src/main/resources/application-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ spring:

jwt:
secret: ${JWT_SECRET}
access-token:
expiration-time: 7200000
refresh-token:
expiration-time: 1209600000

sentry:
dsn: ${SENTRY_DSN}
Expand Down

0 comments on commit cde59d7

Please sign in to comment.