Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
package com.dreamypatisiel.devdevdev.global.security.jwt.model;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class TokenExpireTime {
public static final long ACCESS_TOKEN_EXPIRE_TIME = 1_000 * 60 * 30; // 30분
public static final long REFRESH_TOKEN_EXPIRE_TIME = 1_000 * 60 * 60 * 24 * 7; // 7일
public static final long TEST_TOKEN_EXPIRE_TIME = 1_000 * 60 * 60 * 24 * 21; // 21일
public static long ACCESS_TOKEN_EXPIRE_TIME;
public static long REFRESH_TOKEN_EXPIRE_TIME;

public TokenExpireTime(
@Value("${jwt.expire.access}") long accessTokenExpireTime,
@Value("${jwt.expire.refresh}") long refreshTokenExpireTime
) {
ACCESS_TOKEN_EXPIRE_TIME = accessTokenExpireTime;
REFRESH_TOKEN_EXPIRE_TIME = refreshTokenExpireTime;
}
}
6 changes: 5 additions & 1 deletion src/main/resources/application-jwt-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ jwt:
header: Authorization
secret: devdevdevtestdevdevdevtestdevdevdevtestdevdevdevtest
redirectUri:
path: /
path: /

expire:
access: 1800000 # 30분
refresh: 604800000 # 7일
6 changes: 5 additions & 1 deletion src/test/resources/application-jwt-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
jwt:
secret: devdevdevtestdevdevdevtestdevdevdevtestdevdevdevtest
redirectUri:
path: /home
path: /home

expire:
access: 1800000 # 30분
refresh: 604800000 # 7일
Loading